LoginSignup
4

More than 3 years have passed since last update.

iOS アプリ起動時に "The Google Mobile Ads SDK was initialized without an application ID" で強制終了する場合に必要な対応

Posted at

概要

iOS アプリ起動直後に以下のようなログを出力して強制終了する件について、原因と対応方法をまとめました。

*** Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions at 
https://googlemobileadssdk.page.link/admob-ios-update-plist to set a valid application ID. Google Ad Manager publishers, follow instructions at https://googlemobileadssdk.page.link/ad-manager-ios-update-plist.'

対応方法

ログに含まれている URL を開き、そこに書かれている記載に従い、 Info.plist の修正をする必要があります。

Google AdMob

Google AdMob を利用している場合には、以下リンク先のスタートガイドの記載に従い、 Info.plistGADApplicationIdentifier キーと、それに対応する値( AdMob アプリ ID )を追加します。
https://googlemobileadssdk.page.link/admob-ios-update-plist

追加するキーと値の例
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>

Google Ad Manager

Google Ad Manager を利用している場合には、以下リンク先のスタートガイドの記載に従い、 Info.plistGADIsManagerApp キーと、それに対応する値 YES を追加します。
https://googlemobileadssdk.page.link/ad-manager-ios-update-plist

追加するキーと値の例
<key>GADIsAdManagerApp</key>
<true/>

この問題の背景

上記2つのスタートガイドの両方に記載されているとおり、 Google Mobile Ads SDK のバージョン 7.42.0 以降では、 Info.plist に必要な値を設定しておかないとアプリが強制終了します。

アプリの Info.plist に AdMob アプリ ID を設定する必要があることについては、 Google Mobile Ads SDK のバージョン 7.42.0リリースノートにも書かれています。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
4