广告 SDK 已在没有 AppMeasurement 的情况下初始化

Ads SDK was initialized without AppMeasurement

我知道他们已经更新了 sdk,所以我进行了更改,我很确定我的所有广告代码都与新广告 sdk 文档中的一样。我还提供了新的 ads tracking usage。在info.plist中也提供了App id。所以我不知道为什么我 运行 我的应用程序时总是遇到这个问题。

Google 移动广告 SDK 在没有 AppMeasurement 的情况下进行了初始化。 Google AdMob 发布商,请按照此处的说明操作:https://googlemobileadssdk.page.link/admob-ios-update-plist to include the AppMeasurement framework and set the -ObjC linker flag. Google Ad Manager publishers, follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist

所以,除非有人找到永久解决方案,否则我已经找到了一个临时解决方案。
如果其他人遇到这个问题,您需要将 Podfile 中的 Admob sdk 版本降低到最大 7.677.68 和更高版本面临同样的问题。
pod 'Google-Mobile-Ads-SDK', '7.67.0'

需要在info.plist

中添加以下值
<key>GADIsAdManagerApp</key>
<true/>

对我来说,手动将 -ObjC 链接器标志添加到构建设置修复了它 (OTHER_LDFLAGS)。