在归档我的应用程序时,我收到 Error for Realm

While archiving my application I'm getting Error for Realm

我存档我的应​​用程序,现在想上传到应用程序商店。

当我验证它或上传时发生此错误:

Code signing "Realm.framework" failed

我相信你现在已经解决了这个问题,但对于其他遇到这个问题的人来说,我是这样解决的。

我手动将 Realm 和 RealmSwift 框架拖到我的项目中。当我删除那些框架并通过 Cocoapods 安装 Realm 时,错误消失了。

如果您必须在项目中手动安装框架,请转到框架的常规选项卡并确保团队设置为 None。

如果您使用的是 carthage 领域,如果是这种情况,请不要忘记将脚本添加到构建阶段:

On your application target’s “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:

/usr/local/bin/carthage copy-frameworks and add the paths to the frameworks you want to use under “Input Files”, e.g.:

Copy to $(SRCROOT)/Carthage/Build/iOS/Realm.framework$(SRCROOT)/Carthage/Build/iOS/RealmSwift.framework This script works around an App Store submission bug triggered by universal binaries.

Source

非常重要脚本的顺序必须低于Embed framework: