MobileAds.initialize() must be called prior to getting version string

1,560 views
Skip to first unread message

Marcel

unread,
Jul 12, 2019, 5:09:03 PM7/12/19
to Google Mobile Ads SDK Developers
Need some help. Today I just started receiving the crash below. I am using 
Facebook Audience Mediantion SDK adapter versions:
implementation 'com.facebook.android:audience-network-sdk:5.3.0'
implementation 'com.google.ads.mediation:facebook:5.3.0.0'

Google Ads Version:
implementation "com.google.firebase:firebase-ads:17.2.0"

Captura de Tela 2019-07-12 às 18.07.28.png

I just received more than 6.000 crashes on the last hour. The app was fine, I did not make any update on it, and just today I am getting this crashes.


Fatal Exception: java.lang.IllegalStateException: MobileAds.initialize() must be called prior to getting version string.
       at com.google.android.gms.common.internal.Preconditions.checkState + 29(Preconditions.java:29)
       at com.google.android.gms.internal.ads.zzabc.getVersionString + 87(zzabc.java:87)
       at com.google.android.gms.ads.MobileAds.getVersionString + 16(MobileAds.java:16)
       at com.google.ads.mediation.facebook.FacebookInitializer.initialize + 51(FacebookInitializer.java:51)
       at com.google.ads.mediation.facebook.FacebookMediationAdapter.initialize + 86(FacebookMediationAdapter.java:86)
       at com.google.android.gms.internal.ads.zzanm.zza + 364(zzanm.java:364)
       at com.google.android.gms.internal.ads.zzamu.dispatchTransaction + 194(zzamu.java:194)
       at com.google.android.gms.internal.ads.zzfn.onTransact + 12(zzfn.java:12)
       at android.os.Binder.transact + 499(Binder.java:499)
       at pa.b + 2(pa.java:2)
       at com.google.android.gms.ads.internal.mediation.client.g.a + 16(g.java:16)
       at com.google.android.gms.ads.nonagon.initialization.h.run + 5(h.java:5)
       at android.os.Handler.handleCallback + 751(Handler.java:751)
       at android.os.Handler.dispatchMessage + 95(Handler.java:95)
       at aaj.a(aaj.java)
       at com.google.android.gms.ads.internal.util.e.a + 1(e.java:1)
       at aaj.dispatchMessage(aaj.java)
       at android.os.Looper.loop + 154(Looper.java:154)
       at android.app.ActivityThread.main + 6351(ActivityThread.java:6351)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run + 896(ZygoteInit.java:896)
       at com.android.internal.os.ZygoteInit.main + 786(ZygoteInit.java:786)

Ali asjad

unread,
Jul 13, 2019, 11:14:14 AM7/13/19
to google-adm...@googlegroups.com

I am also facing the same problem. Everything was working fine and then this crash came up!

It affected more than 2000 users!
Please let us know what is going on?

Screenshot 2019-07-13 at 8.12.39 PM.png




Gaurav Kumar

unread,
Jul 13, 2019, 1:51:11 PM7/13/19
to google-adm...@googlegroups.com
Same Here...Effected more than 250 users...

Romain Lebouc

unread,
Jul 13, 2019, 6:32:23 PM7/13/19
to Google Mobile Ads SDK Developers
Same Here. 30% of users had crashes today (from less than 1%). No recent updates.

I could solve the problem with an update but AdMob needs to solve the problem on its side. I cannot have a version which will crash that often until all the users update the app. 

Sébastien Leclerc

unread,
Jul 14, 2019, 12:08:57 PM7/14/19
to Google Mobile Ads SDK Developers
Same issue in my app. Around 5% of sessions are crashing because of this.

It impacts several versions of my app:

Latest version uses:
    implementation 'com.google.firebase:firebase-config:18.0.0'
    implementation 'com.facebook.android:audience-network-sdk:5.2.0'
    implementation 'com.google.ads.mediation:facebook:5.2.0.1'


Previous version (also impacted) uses:
    implementation 'com.google.firebase:firebase-config:17.2.0'
    implementation 'com.facebook.android:audience-network-sdk:5.2.0'
    implementation 'com.google.ads.mediation:facebook:5.2.0.1'



@Google: please rollback whatever change you have rolled out on 12JUL2019 !

Sébastien Leclerc

unread,
Jul 14, 2019, 12:27:42 PM7/14/19
to Google Mobile Ads SDK Developers
@Fellow developers:

Did any of you upgrade to Mobile Ads v18.1.0 yet ?
Does this solve the issue?

There are new instructions about waiting for MobileAds.initialize() to complete before trying to show ads:

public class MainActivity extends AppCompatActivity {

   
protected void onCreate(Bundle savedInstanceState) {
       
super.onCreate(savedInstanceState);
        setContentView
(R.layout.activity_main);

       
MobileAds.initialize(this, new OnInitializationCompleteListener() {
           
@Override
           
public void onInitializationComplete(InitializationStatus initializationStatus) {
           
}
       
});
   
}
}

Romain Lebouc

unread,
Jul 14, 2019, 12:46:43 PM7/14/19
to google-adm...@googlegroups.com
Those dependencies work for me (no more crashes) :

implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-ads:18.0.0'

implementation 'com.facebook.android:audience-network-sdk:5.4.0'
implementation 'com.google.ads.mediation:facebook:5.4.0.0'

I do not know about waiting for initialization to complete (I call AdMob initialization in the onCreate of my app and ads are not loaded on the first screens so I guess initialization is done before the first ads are shown).

FYI, I tried to disable Facebook mediation in the AdMob console but that did not stop the crashes

gautam kumar

unread,
Jul 14, 2019, 3:07:04 PM7/14/19
to Google Mobile Ads SDK Developers
Same here more than 7,000 users per day are affected by it. Although i have updated the dependencies but it will take time for users to update so please @Google revert back the changes made on 11 July on Admob mediation.

Sébastien Leclerc

unread,
Jul 15, 2019, 8:45:20 AM7/15/19
to Google Mobile Ads SDK Developers
Thanks a lot Romain for sharing your findings.

I updated FB SDK to v5.4.1 and so far no issue on this version.

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 23, 2019, 11:18:22 PM7/23/19
to dase...@gmail.com, google-adm...@googlegroups.com
Hi all,

Thank you for your patience on this matter.

The Engineering team just got back to me with news of this issue being fixed in the latest SDK version (18.1.1). Kindly refer to the release notes page for further details.

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

ref:_00D1U1174p._5001U8L2wK:ref

Sanjay

unread,
Aug 27, 2019, 10:50:44 AM8/27/19
to Google Mobile Ads SDK Developers
Although latest SDK version have fixed it but there are many users on that version and app crashing now very often on that version. Is there any way we can fix it?

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 27, 2019, 5:06:03 PM8/27/19
to gautamku...@gmail.com, google-adm...@googlegroups.com
Hello there,

We always suggest the publishers to stay updated with the latest SDK versions as we keep fixing bugs and make improvements in all the new SDK releases. So, please update to the latest version of the SDK to avoid these crashes.

Regards,
Deepika Uragayala

Mobile Ads SDK Team
 

ref:_00D1U1174p._5001UHEoro:ref
Reply all
Reply to author
Forward
0 new messages