Skip to content

Instantly share code, notes, and snippets.

@masaibar
Created January 1, 2019 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masaibar/cb0286d598b220e85a5bb44e0e9e2001 to your computer and use it in GitHub Desktop.
Save masaibar/cb0286d598b220e85a5bb44e0e9e2001 to your computer and use it in GitHub Desktop.
AndroidでAdMobの初期化時にクラッシュする ref: https://qiita.com/masaibar/items/848362349442026063e2
<manifest>
<application>
:
(中略)
:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ADMOB_APP_ID"/>
</application>
</manifest>
MobileAds.initialize(this, ADMOB_APP_ID)
// implementation 'com.google.firebase:firebase-ads:16.0.1' ←アップデート前
implementation 'com.google.firebase:firebase-ads:17.1.2'
2019-01-01 17:15:30.332 30306-30306/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.masaibar.sample, PID: 30306
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: https://goo.gl/fQ2neu to add a valid *
* App ID inside the AndroidManifest. Google Ad Manager publishers should *
* follow instructions here: https://goo.gl/h17b6x. *
******************************************************************************
at android.app.ActivityThread.installProvider(ActivityThread.java:6445)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5987)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5902)
at android.app.ActivityThread.access$1100(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment