【发布时间】:2016-07-22 13:21:35
【问题描述】:
tl;博士
将您的嵌入式框架与其他框架链接,并且不要将其他框架与您的应用程序链接,因为在设备上构建和运行时required code signature missing。
说明:
设置:
我的设置非常简单(Swift 2.3 和 Xcode Xcode 8.0;构建版本 8S162m):
- 使用 Carthage (0.17.2) 我用
xcodebuild8.0 和TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage build --platform iOS构建了 Other.framework - MyApp 已嵌入 My.framework。
- 应用程序和框架项目位于一个 Xcode 工作区下。
- 我只将 Other.framework 链接到 My.framework(这意味着,MyApp 未链接到 Other.framework )。这里的重点是,MyApp 不需要使用 Other.framework API。
问题:
一切似乎都运行良好,直到我在设备上构建并运行应用程序。应用程序启动,然后进程因以下 Xcode 错误而中止:
dyld: Library not loaded: @rpath/Other.framework/Other
Referenced from: /private/var/containers/Bundle/Application/DCF0331F-FF23-43CF-AE79-B3857D5A6EE3/MyApp.app/Frameworks/My.framework/My
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/DCF0331F-FF23-43CF-AE79-B3857D5A6EE3/MyApp.app/Frameworks/My.framework/Frameworks/Other.framework/Other: required code signature missing for '/private/var/containers/Bundle/Application/DCF0331F-FF23-43CF-AE79-B3857D5A6EE3/MyApp.app/Frameworks/My.framework/Frameworks/Other.framework/Other'
我检查了 Other.framework 的签名,我觉得它没问题。此外,
解决方案(解决方法)
将 MyApp 与 Other.framework 链接。太可怕了……这感觉很糟糕。
将完全相同的二进制文件 Other.framework 链接到 MyApp 并以这种方式解决问题,指出,Other.framework 已构建好的并且能够正确地重新签名。可能与迦太基无关。
注意: iOS 8+ framework with nested embedded framework也有类似的问题,不过,我的还有一点别的原因。
【问题讨论】:
-
我遇到了同样的错误,但我正在使用 Xcode 7.3.1 (7D1014) 构建在 iOS 10 设备上运行的应用程序。
标签: ios xcode swift2 xcodebuild ios-frameworks