アプリ起動時にFirebaseのAdMobでGADInvalidInitializationExceptionで落ちる

解決
GoogleService-Info.plistではなくて、Info.plistにGADApplicationIdentifierの設定を追加する。

FirebaseのAdMobをpod updateしたら落ちるようになってしまった。
エラー内容は以下。

*** 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’

-ObjC linker flagも設定しているし、GADApplicationIdentifier設定しているのになんでやーと思ったら、GADApplicationIdentifierを設定していたのが、GoogleService-Info.plistだった。GoogleService-Info.plistではなくて、Info.plistに設定を追加したらなおった。

GADApplicationIdentifierの設定に関しては、公式ドキュメントのEnglish版に書いてあります。
よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

この記事を書いた人

メインはWeb系エンジニアです。

コメント

コメントする

目次