iOS 由于 Cocoapods 安装失败,框架添加失败

iOS Framework addition failed due to a Cocoapods installation failure

当我尝试为 IOS 构建我的 unity 项目时,Unity 产生了一个与 Firebase 和 Cocoapods 相关的错误。我找不到任何解决方案。你能建议我解决这个错误吗? 谢谢

Unity 控制台错误消息;

iOS 由于 CocoaPods 安装失败,框架添加失败。这可能会导致无法正常运行 Xcode 项目。

失败后执行“pod repo update”,成功。然后再次尝试“pod install”,但仍然失败。这可能是由于 CocoaPods 安装损坏所致。请参阅:https://guides.cocoapods.org/using/troubleshooting.html 了解可能的解决方案。

pod 安装输出:

Analyzing dependencies [!] CocoaPods could not find compatible versions for pod "GoogleAppMeasurement": In Podfile: Firebase/Analytics (= 6.32.2) was resolved to 6.32.2, which depends on Firebase/Core (= 6.32.2) was resolved to 6.32.2, which depends on FirebaseAnalytics (= 6.8.2) was resolved to 6.8.2, which depends on GoogleAppMeasurement (= 6.8.2)

Google-Mobile-Ads-SDK (~> 7.68) was resolved to 7.69.0, which depends on GoogleAppMeasurement (~> 7.0)

[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile:

export LANG=en_US.UTF-8 [0m

pod repo update output:

Updating spec repo cocoapods $ /usr/bin/git -C /Users/MacName/.cocoapods/repos/cocoapods fetch origin --progress
$ /usr/bin/git -C /Users/MacName/.cocoapods/repos/cocoapods rev-parse --abbrev-ref HEAD master $ /usr/bin/git -C /Users/MacName/.cocoapods/repos/cocoapods reset --hard origin/master HEAD is now at 43802ecd7335 [Add] iOS_Bootstrap 1.7.6.2

[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile:

export LANG=en_US.UTF-8 [0m

remote: Enumerating objects: 28, done. remote: Counting objects: 3% (1/28) remote: Counting objects: 7% (2/28)
remote: Counting objects: 10% (3/28) remote: Counting objects: 14% (4/28) remote: Counting objects: 17% (5/28)
remote: Counting objects: 21% (6/28) remote: Counting objects: 25% (7/28) remote: Counting objects: 28% (8/28)
remote: Counting objects: 32% (9/28) remote: Counting objects: 35% (10/28) remote: Counting objects: 39% (11/28) remote: Counting objects: 42% (12/28) remote: Counting objects: 46% (13/28) remote: Counting objects: 50% (14/28) remote: Counting objects: 53% (15/28) remote: Counting objects: 57% (16/28) remote: Counting objects: 60% (17/28) remote: Counting objects: 64% (18/28) remote: Counting objects: 67% (19/28) remote: Counting objects: 71% (20/28) remote: Counting objects: 75% (21/28) remote: Counting objects: 78% (22/28) remote: Counting objects: 82% (23/28) remote: Counting objects: 85% (24/28) remote: Counting objects: 89% (25/28) remote: Counting objects: 92% (26/28) remote: Counting objects: 96% (27/28) remote: Counting objects: 100% (28/28) remote: Counting objects: 100% (28/28), done. remote: Compressing objects: 5% (1/17)
remote: Compressing objects: 11% (2/17) remote: Compressing objects: 17% (3/17) remote: Compressing objects: 23% (4/17) remote: Compressing objects: 29% (5/17)
remote: Compressing objects: 35% (6/17) remote: Compressing objects: 41% (7/17) remote: Compressing objects: 47% (8/17) remote: Compressing objects: 52% (9/17)
remote: Compressing objects: 58% (10/17) remote: Compressing objects: 64% (11/17) remote: Compressing objects: 70% (12/17) remote: Compressing objects: 76% (13/17) remote: Compressing objects: 82% (14/17)
remote: Compressing objects: 88% (15/17) remote: Compressing objects: 94% (16/17) remote: Compressing objects: 100% (17/17) remote: Compressing objects: 100% (17/17), done. remote: Total 18 (delta 11), reused 0 (delta 0), pack-reused 0 From https://github.com/CocoaPods/Specs fa8f7a21d8aa..43802ecd7335 master -> origin/master

Podfile 中的 Firebase 和 Google-Mobile-Ads-SDK 版本规范不兼容。

Firebase 6.x 兼容 Google-Mobile-Ads-SDK 最高版本 7.67.0。 7.67.1 之后,需要 Firebase 7.x。

在更改 Firebase 版本之前可以检查用于 Firebase 的所有包是否具有相同的版本。

例如:Analytics 8.1.0 和 Messaging 8.9.0 -> Analytics 8.9.0 和 Messaging 8.9.0

对我来说它成功了。