首页 > 解决方案 > GADInvalidInitializationException 未安装 GoogleMobileAds SDK iOS

问题描述

我正在构建一个本机应用程序,我不打算显示广告,但我有 Firebase 身份验证和其他相关服务。令我惊讶的是,我在下面不断收到此错误。会发生什么?

 *** Terminating app due to uncaught exception 
'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK 
was initialized incorrectly. Google AdMob publishers should follow 
instructions here: https://googlemobileadssdk.page.link/admob-ios- 
update-plist to include the AppMeasurement framework, set the -ObjC 
linker flag, and set GADApplicationIdentifier with a valid App ID. 
Google Ad Manager publishers should follow instructions here: 
https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'

发现这个错误的方法是通过添加来更新 info.plist

 <key>GADIsAdManagerApp</key>
 <true/>

这解决了错误问题,但没有解决根本问题,这就是为什么它需要 GAD 应用程序标识符,因为广告不会显示在应用程序中。

标签: iosxcodefirebasereact-nativeads

解决方案


推荐阅读