xcodebuild exportArchive:找不到适用的设备
升级到iOS 10的Xcode 8后,我得到了这个错误。 我在最新的El Capitan和使用以下版本的ruby(我通过rvm更新,与系统版本2.0.0相同)和CFPropertyList:
Philipps-MacBook-Pro:mobile-sdk prakuschan$ ruby -v ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15] Philipps-MacBook-Pro:mobile-sdk prakuschan$ gem list CF *** LOCAL GEMS *** CFPropertyList (2.3.3)
xcodebuild -exportArchive命令是在shell脚本中执行的,并且在成功存档后,我得到以下错误:
** ARCHIVE SUCCEEDED ** 2016-09-22 10:02:16.460 xcodebuild[10375:8369748] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/9y/r64c9wld0jx2yf3glsrzhhr00000gn/T/AppName_2016-09-22_10-02-16.456.xcdistributionlogs'. 2016-09-22 10:02:18.228 xcodebuild[10375:8369748] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fe435f9dfb0>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.} error: exportArchive: No applicable devices found. Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.} ** EXPORT FAILED **
查看xcdistributionlogs时,IDEDistribution.standard.log最后包含以下几行:
2016-09-22 08:02:18 +0000 [MT] /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with a signal 6 2016-09-22 08:02:18 +0000 [MT] ipatool JSON: (null)
我不知道这是否有价值,但这是ipatool的path:
2016-09-22 08:02:17 +0000 [MT] Running /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool
任何帮助,高度赞赏。 我已经尝试了很多在谷歌上find的build议,但还没有find解决办法。
我看到了同样的问题。 search完毕后:
https://forums.developer.apple.com/thread/13446
和其他地方的Xcode 7类似的问题。 我意识到这是独一无二的。 你可以修复它,如果你在Xcode 8中调整ipatool脚本。
sudo vi /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool
并注释掉这一行:
# Check the artwork idiom. #return nil,"the device doesn't support the app's UIDeviceFamily" unless (deviceTraits.supportedIdioms & bundle.supportedIdioms).size > 0
通过侦测ipatool命令find:
/var/folders/.../IDEDistribution.standard.log
您可以通过以下方式search:
$ sudo find /private/var -name "*.xcdistributionlogs"
相关的细节/debugging步骤: https : //github.com/fastlane/fastlane/issues/8737
运行后,我们遇到了同样的问题"No applicable devices found"
xcodebuild -exportArchive -archivePath ../bin/archive/GetSocialTestApp.xcarchive -exportPath ../bin/ -exportOptionsPlist ../../scripts/exportOptions.plist
工作解决scheme :用xcbuild-safe.sh
从fastlane回购包裹xcodebuild
。 这里描述的详细解
如所示,问题是由rvm
环境variables引起的, xcbuild-safe.sh
在执行xcodebuild
之前清除它们。
我们尝试的解决scheme不工作 :
- 按照此处所述修改
ipatool
脚本 - 降级到ruby2.0.0
- 安装ruby gems
CFPropertyList
,ipatool
正在抱怨的sqlite3
我得到Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found."
与我的企业项目,当包括第三方框架。 我的exportOptionsPlist
文件包含compileBitcode=NO
条目,但项目本身仍然有位码。
我还使用了/var/folders/.../IDEDistribution.standard.log
日志,发现一个更清晰的错误,导致我的解决scheme。
更多信息: https : //developer.apple.com/library/content/technotes/tn2432/_index.html
复制以下内容并将其添加到〜/ .bashrc(〜/ .zshrc,如果您使用的是ZSH)的末尾。 并退出terminal并重新启动(必须) 。
unset RUBYLIB unset RUBYOPT unset BUNDLE_BIN_PATH unset _ORIGINAL_GEM_PATH unset BUNDLE_GEMFILE unset GEM_HOME unset GEM_PATH
供参考:
由于Xcode对2个外部gem有依赖性:sqlite和CFPropertyList更多信息https://github.com/fastlane/fastlane/issues/6495
我们必须为rbenv,rvm以及用户使用bundler时取消这些variables。即使我们在CircleCI等某些环境中不使用rbenv,我们也需要显式地取消设置GEM_HOME和GEM_PATH。 更多信息https://github.com/fastlane/fastlane/issues/627
而已! 设置bitcode = no
,错误得到修复
@Tom Harada答案为我工作,但我想find是什么导致默认ipatool
打破。
这是Google Cast 3.2 SDK,它错过了plist框架的入口。 更新到3.3解决了出口问题。
参考文献: https : //code.google.com/p/google-cast-sdk/issues/detail ? id = 954 https://github.com/fastlane/fastlane/issues/6223#issuecomment-267343853
我的构build脚本有同样的问题,我检查一下我添加的框架。 有一个包含plist文件的框架(名称与Info.plist相同)。 所以,我删除Info.plist文件,生成脚本工作正常。
与XCode 8.2.1有同样的问题
在我的情况下,问题是复制出口的adhoc或appstore分布与以下出口信息plist档案
<?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd> <plist version=1.0> <dict> <key>teamID</key> <string>TEAMID</string> <key>method</key> <string>ad-hoc</string> # or `app-store` <key>uploadSymbols</key> <true/> <key>compileBitcode</key> <false/> <key>uploadBitcode</key> <false/> </dict> </plist>
原来,其中一个链接的框架是使用位码编译的。 这是从xcode导出日志中指出的: IDEDistribution.stadard.log
:
error: Failed to verify bitcode in YandexMapKit.framework/YandexMapKit: error: Bundle only contains bitcode-marker /var/folders/zb/ftpjx10s547ddmzm_ybqdm51xdv_t7/T/IDEDistributionThinningStep.NKQ/Payload/Avito.app/Frameworks/YandexMapKit.framework/YandexMapKit (armv7)
我必须手动将YandexMapKit
项目重新编译为iphoneos
和iphonesimulator
框架,并将它们合并到通用框架
首先,你需要检查你是否已经在你的mac上安装了带有gem的sqlite3和CFPropertyList。 使用这些命令查看terminal中的结果:
-
gem list | grep sqlite3
-
gem list | grep CFPropertyList
如果你什么都不打印,那么你必须用sudo安装它们
-
sudo gem install sqlite3
-
sudo gem install CFPropertyList