You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter集成google_mobile_ads遇Xcode错误:Framework not found GoogleAppMeasurement

解决Flutter集成google_mobile_ads时Xcode报“Framework not found GoogleAppMeasurement”错误

可行解决方案集合

1. 清理Flutter与iOS依赖缓存

执行以下命令彻底清理并重新拉取依赖:

flutter clean
flutter pub get
cd ios
pod deintegrate
pod cache clean --all
pod install

2. 修正Xcode项目的Framework搜索路径

  • 打开iOS目录下的.xcworkspace文件(不要打开.xcodeproj)
  • 在Xcode中选中主项目Target,进入Build Settings标签页
  • 找到Framework Search Paths,确认已包含以下路径(缺失则手动添加):
    $(inherited)
    ${PODS_ROOT}/GoogleAppMeasurement/Frameworks
    ${PODS_ROOT}/GoogleAppMeasurement/Frameworks/GoogleAppMeasurement.framework
    

3. 升级CocoaPods版本

旧版CocoaPods可能存在依赖解析异常,升级至最新版:

sudo gem install cocoapods

4. 强制指定GoogleAppMeasurement版本

在ios/Podfile中添加如下配置,锁定依赖版本后重新安装:

pod 'GoogleAppMeasurement', '~> 10.14.0'

执行pod install生效。

5. 检查版本兼容性

确认Flutter SDK版本与google_mobile_ads: ^3.0.0的兼容关系,必要时升级Flutter或调整插件版本号。

内容的提问来源于stack exchange,提问作者Quincy Keele

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 02:04:58