我正在尝试存档应用并准备在App Store中进行分发。 在存档验证期间(可以从XCode&#39的管理器触发),会弹出以下错误:
据我所知,我的一些包含嵌套框架的框架无法进行编码。如果我删除包含嵌套框架的所有框架,那么它将再次开始工作。
作为示例,以下框架会导致此类错误:
使用Carthage
构建框架以下是我看到的日志输出:
2016-12-02 10:16:53 +0000 Processing step: IDEDistributionCodesignStep
2016-12-02 10:16:53 +0000 Applying entitlements delta for <IDEDistributionItem: 0x7fbc6f6e2a00 'com.hearst.ObjectMapper' '<DVTFilePath:0x7fbc530bde70:'/Users/gruener/Library/Developer/Xcode/Archives/2016-12-02/TestSubmitApp 02-12-16 11.16.xcarchive/Products/Applications/TestSubmitApp.app/Frameworks/Dto.framework/Frameworks/ObjectMapper.framework'>'> from <IDEiCloudEntitlementsProcessor: 0x7fbc6e036e70>: {
}
2016-12-02 10:16:53 +0000 Combining entitlements for <DVTFilePath:0x7fbc525ceb00:'/var/folders/3r/_6fw2smn4vj099_d7j2jtt0cg18svh/T/XcodeDistPipeline.bXb/Root/Payload/TestSubmitApp.app/Frameworks/Dto.framework/Frameworks/ObjectMapper.framework'>
bundleIdentifier = com.hearst.ObjectMapper
profileEntitlements = {
}
storedEntitlements = {
}
extraEntitlements = {
}
2016-12-02 10:16:53 +0000 Entitlements for <IDEDistributionItem: 0x7fbc6f6e2a00 'com.hearst.ObjectMapper' '<DVTFilePath:0x7fbc530bde70:'/Users/gruener/Library/Developer/Xcode/Archives/2016-12-02/TestSubmitApp 02-12-16 11.16.xcarchive/Products/Applications/TestSubmitApp.app/Frameworks/Dto.framework/Frameworks/ObjectMapper.framework'>'>: {
}
2016-12-02 10:16:53 +0000 Writing entitlements for <IDEDistributionItem: 0x7fbc6f6e2a00 'com.hearst.ObjectMapper' '<DVTFilePath:0x7fbc530bde70:'/Users/gruener/Library/Developer/Xcode/Archives/2016-12-02/TestSubmitApp 02-12-16 11.16.xcarchive/Products/Applications/TestSubmitApp.app/Frameworks/Dto.framework/Frameworks/ObjectMapper.framework'>'> to: /var/folders/3r/_6fw2smn4vj099_d7j2jtt0cg18svh/T/XcodeDistPipeline.bXb/entitlementsuaGdWl
2016-12-02 10:16:53 +0000 Running /usr/bin/codesign '-vvv' '--force' '--sign' 'A54D9A9C895E402713C0528523674342C777C825' '--preserve-metadata=identifier,resource-rules' '--entitlements' '/var/folders/3r/_6fw2smn4vj099_d7j2jtt0cg18svh/T/XcodeDistPipeline.bXb/entitlementsuaGdWl' '/var/folders/3r/_6fw2smn4vj099_d7j2jtt0cg18svh/T/XcodeDistPipeline.bXb/Root/Payload/TestSubmitApp.app/Frameworks/Dto.framework/Frameworks/ObjectMapper.framework'
2016-12-02 10:16:53 +0000 Warning: usage of --preserve-metadata with option "resource-rules" (deprecated in Mac OS X >= 10.10)!
2016-12-02 10:16:53 +0000 /var/folders/3r/_6fw2smn4vj099_d7j2jtt0cg18svh/T/XcodeDistPipeline.bXb/Root/Payload/TestSubmitApp.app/Frameworks/Dto.framework/Frameworks/ObjectMapper.framework: replacing existing signature
2016-12-02 10:16:53 +0000 /var/folders/3r/_6fw2smn4vj099_d7j2jtt0cg18svh/T/XcodeDistPipeline.bXb/Root/Payload/TestSubmitApp.app/Frameworks/Dto.framework/Frameworks/ObjectMapper.framework: invalid resource directory (directory or signature have been modified)
2016-12-02 10:16:53 +0000 /usr/bin/codesign exited with 1
我还尝试使用Fastlane的GYM构建IPA文件。在这有效,但是当我尝试提交应用程序时,我收到此错误:
WARNING ITMS-90686: "The binary you uploaded was invalid. (1102)"
Google搜索错误代码1102没有结果;
答案 0 :(得分:2)
我终于找到了问题所在。
我在终端中运行lipo info /path/to/Dto.framework/Dto
,一切都很好 - 不必要的架构被正确剥离了。但仔细看看嵌套框架,我意识到这不是他们的情况。
相反,我发现在使用Carthage时,您必须链接应用级别的所有框架,并且不得将它们封装在您自己的框架中。
为了解决这个问题,我删除了Copy files Phase
(将所有框架复制到frameworks目录)。 Carthage非常聪明,可以识别这一点并检查嵌套的依赖项并为您构建它们。您唯一需要做的就是将它添加到XCode中的链接库构建阶段。
答案 1 :(得分:0)
您可以查看Dto.framework和ObjectMapper.framework中的架构类型吗? 您可以使用
执行此操作$ file /path/to/Dto.framework/Dto
这似乎与我为设备和模拟器构建的一些嵌入式框架的问题类似。模拟器拱是使用调试构建的,它们无法提交到AppStore(ad-hoc存档工作正常)。如果它们包含模拟器拱(x86_64
和i386
),则可以使用此博客中描述的脚本在应用程序的发布版本中剥离模拟器拱:https://gkbrown.org/2015/12/17/creating-a-universal-ios-framework-in-xcode-7/