"The Google Mobile Ads SDK was initialized incorrectly" on Android 4.2.2 - Manifest is ok

3,491 views
Skip to first unread message

ricci....@gmail.com

unread,
Apr 28, 2019, 5:48:58 PM4/28/19
to google-adm...@googlegroups.com
I added Unity Admob SDK v3.16 in my Unity 2019.1.0f project. It works fine on iOS 12.2, but on Android 4.2.2 I am getting the following error (pasted at the end of this message). Unfortunately I am currently unable to try on newer Android versions.
I followed precisely the guide at https://developers.google.com/admob/unity/start, including the manifest part, and the app crashes as soon as it starts.

For better clarity, can you tell me if this manifest row is correct?
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="YOUR_ADMOB_APP_ID"/>
Where...
APPLICATION_ID = the "com.companyname.appname" id I can find in the Google Play Developer Console
YOUR_ADMOB_APP_ID = the "ca-app-pub-####..." code I can find on the AdMob dashboard App List

I also tried various different combinations of app ids and admob app ids but nothing seems to work.
Thanks for any help.

----- UNITY LOGCAT OUTPUT:

04/28 23:34:10.791 5007 5007 Error AndroidRuntime: FATAL EXCEPTION: main
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: ******************************************************************************
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * should follow the instructions here: https://goo.gl/fQ2neu to add a valid  *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * App ID inside the AndroidManifest. Google Ad Manager publishers should     *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * follow instructions here: https://goo.gl/h17b6x.                           *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: ******************************************************************************
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5008)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4618)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4558)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.app.ActivityThread.access$1300(ActivityThread.java:153)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5227)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: Caused by: java.lang.IllegalStateException: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: ******************************************************************************
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * should follow the instructions here: https://goo.gl/fQ2neu to add a valid  *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * App ID inside the AndroidManifest. Google Ad Manager publishers should     *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: * follow instructions here: https://goo.gl/h17b6x.                           *
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: ******************************************************************************
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: 
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at com.google.android.gms.internal.ads.zzabg.attachInfo(Unknown Source)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(Unknown Source)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5005)
04/28 23:34:10.791 5007 5007 Error AndroidRuntime: ... 12 more

mobileadssdk...@google.com

unread,
Apr 29, 2019, 1:07:43 AM4/29/19
to ricci....@gmail.com, Google Mobile Ads SDK Developers
Hi Ricci,

Thank you for reaching out to us, and for posting details about the crash.

Kindly confirm if the app will work if you change the details below in your manifest as follows:

<meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="YOUR_ADMOB_APP_ID"/>

Replace YOUR_ADMOB_APP_ID with the app ID of your application. The android:name section should not be changed.

Let me know if this works for you.

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

On 04/29/19 05:48:58 ricci....@gmail.com wrote:
I added Unity Admob SDK v3.16 in my Unity 2019.1.0f project. It works fine on iOS 12.2, but on Android 4.2.2 I am getting the following error (pasted at the end of this message). Unfortunately I am currently unable to try on newer Android versions.
I followed precisely the guide at https://developers.google.com/admob/unity/start, including the manifest part, and the app crashes as soon as it starts.

For better clarity, can you tell me if this manifest row is correct?
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="YOUR_ADMOB_APP_ID"/>
Where...
APPLICATION_ID = the "com.companyname.appname" id I can find in the Google Play Developer Console
YOUR_ADMOB_APP_ID = the "ca-app-pub-####..." code I can find on the AdMob dashboard App List

I also tried various different combinations of app ids but nothing seems to work.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/1ef366b1-9e7e-4939-934a-dbf36326a4c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ricci....@gmail.com

unread,
Apr 29, 2019, 2:45:07 PM4/29/19
to google-adm...@googlegroups.com
Hi, thanks, the app is now starting. Unfortunately, after some moments, it slows down to an halt without crashing, and gets stuck. As far as I can understand from logcat, it's trying to upload some logs but then crashes on authentication...? What is happening here precisely? The only Google service I have in the app is ads, I don't have any other kind of service in.

EDIT: Ok, weirdly enough, the app didn't start because I was signed off from Google on the test phone, in fact the app worked well without WiFi or 3/4G. I signed back in and now everything works. Thanks again.

04/29 20:35:11.203 3337 3412 Info PlayCommon: [159] acij.d(23): Preparing logs for uploading
04/29 20:35:11.228 2873 2885 Info GLSUser: GLS error: BadAuthentication ricci....@gmail.com oauth2:https://www.googleapis.com/auth/googleplay
04/29 20:35:11.228 2873 2885 Verbose GoogleLoginService: Returning error intent with: ComponentInfo{com.google.android.gsf.login/com.google.android.gsf.login.LoginActivity}
04/29 20:35:11.248 3337 3412 Warn PlayCommon: [159] acij.d(115): Deferring log upload because couldn't retrieve auth token
04/29 20:35:11.308 2299 2301 Debug dalvikvm: GC_CONCURRENT freed 856K, 26% free 9651K/13000K, paused 1ms+5ms, total 32ms
04/29 20:35:12.848 3337 3628 Info PlayCommon: [195] acij.d(23): Preparing logs for uploading
04/29 20:35:12.853 3337 3628 Warn PlayCommon: [195] acij.a(1): No account for auth token provided
04/29 20:35:12.853 3337 3628 Info PlayCommon: [195] acij.d(125): Connecting to server: https://play.googleapis.com/play/log?format=raw&proto_v2=true
04/29 20:35:13.083 3337 3628 Info PlayCommon: [195] acij.d(173): Successfully uploaded logs.
04/29 20:35:13.088 3337 3339 Debug dalvikvm: GC_CONCURRENT freed 1175K, 46% free 6113K/11268K, paused 5ms+9ms, total 51ms
04/29 20:35:39.458 2175 2254 Debug lights: set_light_buttons on=1
04/29 20:35:42.068 2608 2608 Info Auth: [AuthDelegateWrapper] Service intent: Intent { cmp=com.google.android.gms/.auth.account.authenticator.DefaultAuthDelegateService }.
04/29 20:35:42.073 2608 2608 Info Auth: [AuthDelegateWrapper] Service intent: Intent { cmp=com.google.android.gms/.auth.account.authenticator.DefaultAuthDelegateService }.
04/29 20:35:42.108 2608 2612 Debug dalvikvm: GC_CONCURRENT freed 567K, 45% free 4219K/7592K, paused 2ms+1ms, total 27ms
04/29 20:35:42.138 2608 4439 Error Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:1672372287>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/gcm
04/29 20:35:42.138 2608 4439 Error Auth: ejz: Long live credential not available.
04/29 20:35:42.138 2608 4439 Error Auth: at eka.a(SourceFile:3099)
04/29 20:35:42.138 2608 4439 Error Auth: at ein.a(SourceFile:397)
04/29 20:35:42.138 2608 4439 Error Auth: at eim.a(SourceFile:31369)
04/29 20:35:42.138 2608 4439 Error Auth: at eim.a(SourceFile:313)
04/29 20:35:42.138 2608 4439 Error Auth: at fjx.a(SourceFile:1201)
04/29 20:35:42.138 2608 4439 Error Auth: at fjw.a(SourceFile:530)
04/29 20:35:42.138 2608 4439 Error Auth: at fjw.a(SourceFile:196)
04/29 20:35:42.138 2608 4439 Error Auth: at efm.a(SourceFile:284)
04/29 20:35:42.138 2608 4439 Error Auth: at efm.a(SourceFile:204)
04/29 20:35:42.138 2608 4439 Error Auth: at bda.onTransact(SourceFile:137)
04/29 20:35:42.138 2608 4439 Error Auth: at android.os.Binder.execTransact(Binder.java:351)
04/29 20:35:42.138 2608 4439 Error Auth: at dalvik.system.NativeStart.run(Native Method)
04/29 20:35:42.148 2608 4439 Info Auth: [DefaultAuthDelegateChimeraService] Use browser flow? false
04/29 20:35:42.158 3251 4600 Info GCM-GMS: Failed to subscribe to group.
04/29 20:35:42.158 3251 4600 Info GCM-GMS: ege: BadAuthentication
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at efr.a(SourceFile:1526)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at efq.a(SourceFile:920)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at efq.e(SourceFile:534)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at efq.d(SourceFile:454)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at efq.b(SourceFile:446)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at efo.a(SourceFile:523)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at och.a(SourceFile:441)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at och.a(SourceFile:335)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at och.b(SourceFile:202)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at com.google.android.gms.gcm.gmsproc.GcmInGmsTaskChimeraService.a(SourceFile:39)
04/29 20:35:42.158 3251 4600 Info GCM-GMS: at oas.run(SourceFile:179)
04/29 20:35:42.168 3251 4600 Info GCM-GMS: Groups upload failed
04/29 20:35:42.178 2608 3803 Debug GCM: GcmService start Intent { act=com.google.android.gcm.intent.SEND flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.GcmService (has extras) } com.google.android.gcm.intent.SEND
04/29 20:35:44.458 2175 2242 Debug lights: set_light_buttons off
04/29 20:36:28.353 2623 3574 Warn ctxmgr: [AclManager]checkPermissionTypeStatus: no inject permission for { uid=10050, packageName=com.google.android.gms }. Returned permission was: PACKAGE_NOT_WHITELISTED for context name=POWER_CONNECTION, account=account#-517948760#
04/29 20:36:28.353 2623 3574 Warn ctxmgr: [AclManager]checkPermissionTypeStatus: no inject permission for { uid=10050, packageName=com.google.android.gms }. Returned permission was: PACKAGE_NOT_WHITELISTED for context name=POWER_CONNECTION, account=account#-517948760#
04/29 20:36:28.353 2623 2623 Error ctxmgr: [PowerConnectionProducer]Could not write powerInfo=Plug state: 2 BatteryLevel: 0.97, status=Status{statusCode=unknown status code: 7503, resolution=null}

mobileadssdk...@google.com

unread,
Apr 29, 2019, 11:44:23 PM4/29/19
to ricci....@gmail.com, Google Mobile Ads SDK Developers
Hi Ricci,

Thank you for posting the error log.

Can you try your ad unit ID with our sample app and see if it will work on your end? You may also send us a copy of your project file using the Reply privately to author option so that we may test it as well.

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team
On 04/30/19 02:45:07 ricci....@gmail.com wrote:
Hi, thanks, the app is now starting. Unfortunately, after some moments, it slows down to an halt without crashing, and gets stuck. As far as I can understand from logcat, it's trying to upload some logs but then crashes on authentication...? What is happening here precisely?

Il giorno lunedì 29 aprile 2019 07:07:43 UTC+2, mobileadssdk-forumadvisor ha scritto:
Hi Ricci,

Thank you for reaching out to us, and for posting details about the crash.

Kindly confirm if the app will work if you change the details below in your manifest as follows:

<meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="YOUR_ADMOB_APP_ID"/>

Replace YOUR_ADMOB_APP_ID with the app ID of your application. The android:name section should not be changed.

Let me know if this works for you.

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

ricci....@gmail.com

unread,
Apr 30, 2019, 1:56:20 AM4/30/19
to Google Mobile Ads SDK Developers
Hi, looking at the message you quoted, you probably missed my edit on it.
The freeze apparently was because I wasn't signed in with Google on the test phone. As soon as I signed in, the game started without problems and no further freezes or crashes happened. I later rolled out the update and looks like it's working fine on other devices too.
Thanks again!


Il giorno martedì 30 aprile 2019 05:44:23 UTC+2, mobileadssdk-forumadvisor ha scritto:
Hi Ricci,

Thank you for posting the error log.

Can you try your ad unit ID with our sample app and see if it will work on your end? You may also send us a copy of your project file using the Reply privately to author option so that we may test it as well.

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages