我花了好几天时间在这件事上.我已经try 了许多flatter 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中删除什么?我累了.

播客文件:

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-SDK看了几个小时后,我想为什么不手动更改.symlinks文件夹中的版本呢.我没有工作,我得到了一些关于一些丢失凭据的错误.然后我搜索了google_mobile_ads ios,发现最新的版本非常高.Flutter 使用的最大版本是go 年的2021‑11‑17.我猜想将其迁移到SDK v9可能会有问题(我不知道这是什么).无论如何,这只是一个理论,我对iOS插件知之甚少.

现在的解决方案,我想至少有人在github上有同样的问题,我是对的,这是一个p1问题,所以希望它能很快得到修复.现在,只需像这样替换依赖项:

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

github上的@jonafeucht说.这是一个解决方法,但我还没有发现任何问题.虽然为了让项目运行,我不得不修复我为自己创建的一些其他问题.

Ios相关问答推荐

如何在进行滑动删除操作时保持自定义视图背景静态

如何调整包含extView的UICollectionViewListCell的大小?

第三方框架的iOS隐私声明

缺少预期的键:';NSPrival yCollectedDataTypes';

如何在iPhone 15上消除.NET Maui中状态栏和页面之间的差距

与iPadOS中带有扣件的模式相似的组件是什么?

磁盘上的Objective-C ISA指针与实例化对象时的比较

Swift-如何通过Case Let访问模型变量

为什么applicationState发布者只发布一次?

表视图(SwiftUI)中的多列?

动画文本位置

我需要二进制文件来进行 App Store 应用程序传输吗?

如何在应用程序中显示我的小部件的快照?

转换在 NavigationView 中不起作用

Apple Push Service 证书不受信任

如何从 scendelegate 打开我的标签栏控制器

无效的 iPhone 应用程序二进制文件

Xcode 4.2 如何将一个项目包含到另一个项目中?

iOS SDK - 以编程方式生成 PDF 文件

如何在 Swift 中更改按钮标题对齐方式?