gpt4 book ai didi

ios - 无法为 Flutter 项目构建 ipa [CocoaPods 找不到 pod "GoogleAppMeasurement":] 的兼容版本

转载 作者:行者123 更新时间:2023-12-03 08:04:25 25 4
gpt4 key购买 nike

我花了好几天的时间来解决这个问题。我尝试了很多 flutter pub 和 pod 命令,但没有任何效果。我还删除了 pods 文件夹并重新添加了 firebase-ios-sdk。

我一直看到这个:

  In Podfile:
firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) was resolved to 9.1.12, which depends on
Firebase/Analytics (= 9.2.0) was resolved to 9.2.0, which depends on
Firebase/Core (= 9.2.0) was resolved to 9.2.0, which depends on
FirebaseAnalytics (~> 9.2.0) was resolved to 9.2.0, which depends on
FirebaseAnalytics/AdIdSupport (= 9.2.0) was resolved to 9.2.0, which depends on
GoogleAppMeasurement (= 9.2.0)

google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`) was resolved to 0.0.1, which depends on
Google-Mobile-Ads-SDK (= 8.13.0) was resolved to 8.13.0, which depends on
GoogleAppMeasurement (< 9.0, >= 7.0)

所以我绝望了,删除了整个 ios 文件夹,然后运行 ​​flutter create 。 它重新生成了所有内容,然后我运行 flutterfire configure 。一切看起来都很好,但我仍然无法构建或运行针对 ios 的应用程序。我认为不知何故,xcode 保留了一些设置或文件,而 pod cache clean 甚至没有删除它。我应该在 xcode 中删除/删除什么?我累了。

Podfile:

platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end

最佳答案

[编辑] google_mobile_ads 2.0.0已发布以解决此问题🎉

所以我找到了解决方案。在盯着 Google-Mobile-Ads-SDK 几个小时后,我想为什么不手动更改 .symlinks 文件夹中的版本。我没有工作,并且收到一些关于缺少凭证的错误。于是我搜索了 google_mobile_ads ios 并发现可用的最新版本是如此之高。 flutter 使用的最大版本是去年的 2021-11-17 版本。我的猜测是,将其迁移到 SDK v9 可能会遇到问题(我不知道那是什么)。无论如何,这只是一个理论,我对 iOS 插件了解不多。

现在是解决方案,我认为 github 上至少有人遇到了同样的问题,我是对的 google_mobile_ads这是一个 p1 问题,希望很快就能解决。现在,只需替换依赖项,如下所示:

  google_mobile_ads:
git:
url: https://github.com/googleads/googleads-mobile-flutter
ref: 356875362ddb2ac2e0056385d2729c093722fb8d
path: packages/google_mobile_ads

它会像 github 上的 @jonafeucht 所说的那样工作。这是一种解决方法,但到目前为止我还没有发现任何问题。尽管我必须解决一些我为自己创建的其他问题,以尝试让项目运行。

关于ios - 无法为 Flutter 项目构建 ipa [CocoaPods 找不到 pod "GoogleAppMeasurement":] 的兼容版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72861817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com