更新 iOS 后,所有使用该框架的应用程序在设备上停止 运行ning,但它们在模拟器上 运行

After updating iOS, all applications using the framework stopped running on the device, but they run on the simulator

错误:
{ dyld:库未加载:@rpath/Realm.framework/Realm 引用自:/private/var/containers/Bundle/Application/43190AF8-F437-4B8F-9827-DDEA599AF618/Favorite 个地方。app/Favorite 个地方 原因:没有找到合适的图像。找到了: /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 似乎改变了免费苹果开发者帐户的行为,不再允许他们使用嵌入式框架。

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

例如

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

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

正在删除 use_frameworks。它会破坏你的 Firebase pods。 对于使用 Firebase pods 的项目,您的解决方案包括以下内容..

  1. 降级您的 iOS 设备
  2. 创建并支付 Apple Developer Program
  3. 使用模拟器并等待将来的 iOS 更新,这些更新有望再次允许免费开发帐户再次使用框架..

这是一个经常出现的问题,需要通过官方渠道解决

评论use_frameworks,然后改用use_modular_headers!

#use_frameworks!

use_modular_headers!

# Pods for NoteWithFireStore

pod 'BoringSSL-GRPC'

pod 'Firebase/Analytics'

pod 'Firebase/Firestore'

pod 'Firebase/Storage'

pod 'BoringSSL-GRPC', '= 0.0.3', :modular_headers => false

pod 'gRPC-Core', '= 1.21.0', :modular_headers => false

尝试使用 Xcode 11.4 和 iOS 13.4 使用 Firebase 和免费开发帐户。此组合解决了问题

好吧,我遇到了一个非常相似的问题。不需要支付我的开发者帐户续订费用。是的,我目前使用的是免费帐户。更新到 13.4 和 xcode 11.4 仍然显示相同的问题。这就是我所做的:

- 已删除应用程序 phone,清理构建并删除旧配置文件(在

中找到

~/Library/MobileDevice/Provisioning Profiles)

-删除了在

中找到的“iOS DeviceSupport”文件中的所有内容

~/Library/Developer

-清理派生数据。

-在钥匙串中我删除了所有证书。

还删除了我的帐户并在重新启动时重新添加它 xcode(IMO 这可能什么也没做,但值得添加)。重新启动 phone 和 xcode。应用程序已启动,现在 运行 在我的 phone 上了!没有付费开发者帐户!哦还有 podfile...

platform :ios, '13.2'

target 'YourApp' do
  use_frameworks!
  pod 'Mapbox-iOS-SDK', '~> 5.7.0'

 
 target 'WalkBuddyTests' do
    inherit! :search_paths
    #pods for testing
end
end

我一直面临同样的问题...通过添加解决了问题:

在你的播客文件中:

use_modular_headers!

而不是

use_frameworks!

祝你好运!我希望这对你有用!

同样的问题。只需重新创建配置文件即可解决。