ios - 更新iOS后,所有使用该框架的应用程序都停止在设备上运行,而是在模拟器上运行

标签 ios xcode firebase realm cocoapods

错误:
{
dyld:库未加载:@rpath/Realm.framework/Realm
引用自:/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Favorite Places
原因:没有找到合适的图片。发现:
/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm:代码签名对'/private/var/containers/Bundle/Application/无效43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm'

    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: stat() failed with errno=25
    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: code signature invalid for '/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm'

    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: stat() failed with errno=1
    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: code signature invalid for '/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm'

    /private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite Places.app/Frameworks/Realm.framework/Realm: stat() failed with errno=1
(lldb) 
}

最佳答案

我对 Realm 有同样的问题,它可以在模拟器上运行,但在实际设备上会立即崩溃。
似乎在更新到 iOS 13.3.1 时,Apple 改变了免费苹果开发者帐户的行为,不再允许他们使用嵌入式框架。

解决方案是删除 use_frameworks!在您的 Podfile 中并将其替换为 use_modular_headers!
例如

target 'your_project_name' do
    use_modular_headers!
    pod 'RealmSwift'
end

这会将它们包含为静态库。
我偶然发现了这个 GitHub 问题中的解决方案:
https://github.com/Alamofire/Alamofire/issues/3051

关于ios - 更新iOS后,所有使用该框架的应用程序都停止在设备上运行,而是在模拟器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60045282/

相关文章:

java - Crashlytics发送到报告端点已禁用

ios - 如何在 iOS 中获取 Firebase URL?

swift - 未找到 x86_64 架构的 -lswiftCoreFoundation 库

ios - 无法实时获取 UserDefaults 更新值

ios - 如何调用电子邮件应用程序?

ios - UIImageView 的 UITextField subview 不响应触摸事件

ios - iOS项目代码覆盖率源文件是相对路径

swift - Xcode 中的索引超出范围错误

ios - 依赖第一个组件的 UIPickerView 不更新 UI

ios - Swift:按下后更改按钮颜色