ios - RealmSwift (0.92.3) 和配置文件错误

标签 ios swift realm

当我尝试用我的 iPhone 设备运行我的 watchkit 应用程序时出现以下错误消息(即模拟器运行良好):

dyld: Library not loaded: @rpath/RealmSwift.framework/Frameworks/Realm.framework/Realm
  Referenced from: /private/var/mobile/Containers/Bundle/Application/9CCC-B93-89-4E6/MyApp.app/MyApp

Reason: no suitable image found.  Did find:
        /private/var/mobile/Containers/Bundle/Application/9CC8D-43AE7-F8E/MyApp.app/Frameworks/RealmSwift.framework/Frameworks/Realm.framework/Realm:

code signature invalid for '/private/var/mobile/Containers/Bundle/Application/9C98D-435D-A8E6/MyApp.app/Frameworks/RealmSwift.framework/Frameworks/Realm.framework/Realm'
(lldb) 

知道要做什么吗???任何帮助表示赞赏!

最佳答案

解决方案是在应用的目标中创建一个新的“运行脚本阶段”,如 realm.io 中所述。页:

"If using Realm in an iOS project, create a new “Run Script Phase” in your
app’s target’s “Build Phases” and paste the following snippet in the script
text field:

bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework/strip-frameworks.sh"

This step is required to work around an App Store submission bug when
archiving universal binaries."

这是一张关于如何在 Xcode-menu 中查找以及它最终的样子的截图!

enter image description here

enter image description here

关于ios - RealmSwift (0.92.3) 和配置文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30270195/

相关文章:

ios - 即使添加了所有约束,UITableViewCell 高度也不会动态计算

iphone - UITableView - 方法未被调用

ios - 在 Admob 横幅上显示 UIButton?

ios - 滑动时单个标签更新值

java - Android Realm getInstance 性能

ios - 如何在 ios 7 中更改 UILocalizedIndexedCollat​​ion 的背景颜色

ios - 如何在 MapView 上一次放置 500 个图钉

swift - CLLocationManager 只工作一次

json - 如何在 Swift 中将 Realm 对象转换为 JSON?

ios - -[__NSCFNumber 行] : unrecognized selector sent to instance