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
相关产品推荐
相关产品推荐

