nativescript-admob icon indicating copy to clipboard operation
nativescript-admob copied to clipboard

Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider

Open javierpal opened this issue 6 years ago • 7 comments

For some reason I get this error, the only thing i recall doing is test the ios version of the app for the first time so i installed the cocoa pods and run it in ios and it worked, then i try to run it in android again and the app does not even start, this is the complete error log. tns platform remove/add does not seem to work either.

`FATAL EXCEPTION: main 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:5177)
                                                                              at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
                                                                              at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
                                                                              at android.app.ActivityThread.-wrap1(ActivityThread.java)
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                              at android.os.Looper.loop(Looper.java:148)
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5443)
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
                                                                           Caused by: java.lang.IllegalStateException: `

javierpal avatar Oct 05 '18 22:10 javierpal

@javierpal I've got the same errors too. I have followed the instruction stated in https://goo.gl/fQ2neu by adding <manifest> <application> <!-- TODO: Replace with your real AdMob app ID --> <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-################~##########"/> </application> </manifest>

But unfortunately, nothing has changed!

here you can get more info about the errors, https://ads-developers.googleblog.com/2018/10/announcing-v1700-of-android-google.html has mentioned about the change of admob sdk.

shilik avatar Oct 09 '18 13:10 shilik

@shilik it's weird because i did it too and it worked fine later, one more thing the only line you need to add is: <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="[ADMOB_APP_ID]"/>

inside manifest/application check if you have it right. I put it at the end of the data that was already there.

javierpal avatar Oct 09 '18 19:10 javierpal

@javierpal I have tried several times and failed until I noticed your reminder "...at the end of the data". Finally, I got the app back to life again! Thank you!

shilik avatar Oct 10 '18 01:10 shilik

"... AT THE END OF THE MANIFEST/APPLICATION ", after two days of trial i finally get rid of the error. grate answer thank you!!

bereket-kassahun avatar Apr 10 '19 06:04 bereket-kassahun

@bereket-kassahun Just so I can make sure the instructions in this repo are still correcht, is your solution any different than adding this and the instruction here? If so, how can we make that more clear?

EddyVerbruggen avatar Apr 10 '19 06:04 EddyVerbruggen

though i put this code on my manifest file but still my app is crushed

TawfiqHasan avatar Aug 03 '19 04:08 TawfiqHasan

"... AT THE END OF THE MANIFEST/APPLICATION ", after two days of trial i finally get rid of the error. grate answer thank you!!

i had this problem to...

"... AT THE END OF THE MANIFEST/APPLICATION "

willagner avatar Apr 07 '21 01:04 willagner