Hi:
I used the latest Admob native sdk in my application.
The Doc link is: https://firebase.google.com/docs/admob/android/native-advanced
The native ad is more beautiful than before, but i found some NullPointerExceptions in my UMeng server:
There are two categories issues:
1. Happens on the android platform: 4.0, 4.1, 4.2, 4.3, 4.4:
java.lang.NullPointerException
at rx.a(:com.google.android.gms.DynamiteModulesA:686)
at rr.a(:com.google.android.gms.DynamiteModulesA:3308)
at rt.a(:com.google.android.gms.DynamiteModulesA:1230)
at avl.a(:com.google.android.gms.DynamiteModulesA:840)
at awb.run(:com.google.android.gms.DynamiteModulesA:45)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5633)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)
at dalvik.system.NativeStart.main(NativeStart.java)
2. Happens on the android platform: 5.0, 5.1, 6.0
java.lang.NullPointerException: Attempt to invoke interface method 'android.view.View xq.e()' on a null object reference
at rx.a(:com.google.android.gms.DynamiteModulesA:686)
at rr.a(:com.google.android.gms.DynamiteModulesA:3308)
at rr.onGlobalLayout(:com.google.android.gms.DynamiteModulesA:561)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:986)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2210)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1301)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7016)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Following is my code:
app/build.gradle
dependencies {
…
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.android.gms:play-services-appinvite:9.0.0'
…
compile 'com.google.firebase:firebase-ads:9.0.0'
}
In My Activity.
AdLoader mAdLoder;
NativeContentAd mContentAd;
NativeContentAdView mAdview;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mAdLoder = new AdLoader.Builder();
mAdview = findViewById(R.id.xxx);
...
}
@Override
protected void onResume() {
...
//Just illustrate the ContentAD callback state.
if (mContentAd != null) {
mContentAd.destroy();
}
if (mAdLoder != null && !mAdLoder.isLoading()) {
AdRequest adRequest = new AdRequest.Builder().build();
mAdLoder.loadAd(adRequest);
}
...
}
@Override
protected void onPause() {
...
if (mContentAd != null) {
mContentAd.destroy();
mContentAd = null;
}
...
}
@Override
protected void onDestroy() {
...
// I cannot find other Api to release adLoader, so i do it as following:
mAdview.destroy();
...
}
Is there any problems on my code? If not what should i do to resolve this issue or make a work around about it.
Thanks
HI Vu:
Thank you for your reply.
I have added my comments below your questions.
BR
Keven
Hi Keven,Your code looks fine. Calling .destroy() in the Activity#onDestroy() is correct. Just to make sure we are on the same page, I have a couple of questions for you:
- Are you able to replicate this crash locally when you use our sample Native Ad project? Let us know if you are able to. If the crash doesn't happen, something might be up with a specific creative that is shown.
RE: These are random crash, i cannot reproduce the issue on my device, The crash logs were found on my analyse server and produce by end users, so i think i cannot reproduce this issue based on the sample code.
- Would you be interested in implementing Native Ad Express? With Native Ad Express, we are offloading all creative-specific logic to the server, so there's minimal work you'd need to worry about in your client-side code. That reduces any edge cases for code-based crashes.
RE: I implemented the native ad before, but i need redefine the layout of native ad, so I change to com.google.firebase:firebase-ads:9.0.0 instead of com.google.android.gms:play-services-ads:9.0.0, then the issue comes. I am sorry, i cannot implement the Native Ad Express to avoid the issue.
Hi Vu:
We are trying to fix this issue, find a doc in release note: Doc Link
We do not add the line into our ProGuard file in our release version.
Is the issue related to the ProGuard configuration?
Should we fix this issue, if added the line into our ProGuard file?
BR
Keven
Hi Vu:
We have updated the version of Firebase from 9.0.0 to 9.0.2, also can reproduce this issue.
Thanks.
BR
Keven
java.lang.ExceptionInInitializerError
at hrh.<init>(:com.google.android.gms:99)
at hrh.<init>(:com.google.android.gms:85)
at hqu.<init>(:com.google.android.gms:14)
at hrb.<init>(:com.google.android.gms:35)
at com.google.android.gms.chimera.container.GmsModuleFinder.b(:com.google.android.gms:437)
at com.google.android.gms.chimera.container.DynamiteLoaderImpl.getModuleVersion2(:com.google.android.gms:43)
at krn.onTransact(:com.google.android.gms:83)
at android.os.Binder.transact(Binder.java:361)
at aqb.a(:com.google.android.gms.DynamiteModulesA:155)
at apn.a(:com.google.android.gms.DynamiteModulesA:293)
at apo.a(:com.google.android.gms.DynamiteModulesA:97)
at app.a(:com.google.android.gms.DynamiteModulesA:108)
at apn.a(:com.google.android.gms.DynamiteModulesA:216)
at mu.<init>(:com.google.android.gms.DynamiteModulesA:44)
at mu.a(:com.google.android.gms.DynamiteModulesA:32)
at com.google.android.gms.ads.internal.overlay.bb.a(:com.google.android.gms.DynamiteModulesA:21)
at com.google.android.gms.ads.internal.c.a(:com.google.android.gms.DynamiteModulesA:537)
at com.google.android.gms.ads.internal.c.a(:com.google.android.gms.DynamiteModulesA:144)
at com.google.android.gms.ads.internal.a.a(:com.google.android.gms.DynamiteModulesA:312)
at com.google.android.gms.ads.internal.z.run(:com.google.android.gms.DynamiteModulesA:100)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at hbu.a(:com.google.android.gms:1246)
at hbr.b(:com.google.android.gms:198)
at com.google.android.gms.common.threads.internal.GlobalExecutorsImpl.<clinit>(:com.google.android.gms:1217)
... 29 more
java.lang.NullPointerException
at hbu.a(:com.google.android.gms:1246)
at hbr.b(:com.google.android.gms:198)
at com.google.android.gms.common.threads.internal.GlobalExecutorsImpl.<clinit>(:com.google.android.gms:1217)
at hrh.<init>(:com.google.android.gms:99)
at hrh.<init>(:com.google.android.gms:85)
at hqu.<init>(:com.google.android.gms:14)
at hrb.<init>(:com.google.android.gms:35)
at com.google.android.gms.chimera.container.GmsModuleFinder.b(:com.google.android.gms:437)
at com.google.android.gms.chimera.container.DynamiteLoaderImpl.getModuleVersion2(:com.google.android.gms:43)
at krn.onTransact(:com.google.android.gms:83)
at android.os.Binder.transact(Binder.java:361)
at aqb.a(:com.google.android.gms.DynamiteModulesA:155)
at apn.a(:com.google.android.gms.DynamiteModulesA:293)
at apo.a(:com.google.android.gms.DynamiteModulesA:97)
at app.a(:com.google.android.gms.DynamiteModulesA:108)
at apn.a(:com.google.android.gms.DynamiteModulesA:216)
at mu.<init>(:com.google.android.gms.DynamiteModulesA:44)
at mu.a(:com.google.android.gms.DynamiteModulesA:32)
at com.google.android.gms.ads.internal.overlay.bb.a(:com.google.android.gms.DynamiteModulesA:21)
at com.google.android.gms.ads.internal.c.a(:com.google.android.gms.DynamiteModulesA:537)
at com.google.android.gms.ads.internal.c.a(:com.google.android.gms.DynamiteModulesA:144)
at com.google.android.gms.ads.internal.a.a(:com.google.android.gms.DynamiteModulesA:312)
at com.google.android.gms.ads.internal.z.run(:com.google.android.gms.DynamiteModulesA:100)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
Hi:
I got 51 app crashes in 3 days with this crash report:
Fatal Exception: java.lang.ExceptionInInitializerError
at hrh.(:com.google.android.gms)
at hrh.(:com.google.android.gms)
at hqu.(:com.google.android.gms)
at hrb.(:com.google.android.gms)
at com.google.android.gms.chimera.container.GmsModuleFinder.b(:com.google.android.gms:437)
at com.google.android.gms.chimera.container.DynamiteLoaderImpl.getModuleVersion2(:com.google.android.gms:43)
at krn.onTransact(:com.google.android.gms:83)
at android.os.Binder.transact(Binder.java:361)
at aqb.a(:com.google.android.gms.DynamiteModulesA:155)
at apn.a(:com.google.android.gms.DynamiteModulesA:293)
at apo.a(:com.google.android.gms.DynamiteModulesA:97)
at app.a(:com.google.android.gms.DynamiteModulesA:108)
at apn.a(:com.google.android.gms.DynamiteModulesA:216)
at mu.(:com.google.android.gms.DynamiteModulesA)
at mu.a(:com.google.android.gms.DynamiteModulesA:32)
at com.google.android.gms.ads.internal.overlay.bb.a(:com.google.android.gms.DynamiteModulesA:21)
at com.google.android.gms.ads.internal.zzb.zza(:com.google.android.gms.DynamiteModulesA:537)
at com.google.android.gms.ads.internal.zzb.zza(:com.google.android.gms.DynamiteModulesA:144)
at com.google.android.gms.ads.internal.ClientApi.retainReference(:com.google.android.gms.DynamiteModulesA:312)
at com.google.android.gms.ads.internal.zzn.zza(:com.google.android.gms.DynamiteModulesA:116)
at com.google.android.gms.ads.internal.client.zzz.onTransact(:com.google.android.gms.DynamiteModulesA:81)
at android.os.Binder.transact(Binder.java:361)
at com.google.android.gms.ads.internal.client.zzu$zza$zza.zzaM(Unknown Source)
at com.google.android.gms.ads.internal.client.zzab.destroy(Unknown Source)
at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
at com.google.android.gms.ads.AdView.resume(Unknown Source)
at club.androidy.callcontrolfree.Activities.MainActivity.onCreate(MainActivity.java:182)
at android.app.Activity.performCreate(Activity.java:5289)
It's happening on HUAWEI Y625 phones with android version 4.4.2 only
I'm using SDK version 8.4.0 as the latest version doesn't deliver ads to devices that doesn't have google play services installed.
compile 'com.google.android.gms:play-services-ads:8.4.0'
The line that causes the issue is
mAdView.loadAd(adRequest);
I tried to just catch the exception with try/catch
but it seems that's not working because the app is still crashing.
Fatal Exception: java.lang.RuntimeException: Unable to pause activity {com.<APP-PACKAGE>/com.google.android.gms.ads.AdActivity}: java.lang.IllegalArgumentException: Service not registered: awx@ef02364 at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3381) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3340) at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3315) at android.app.ActivityThread.access$1100(ActivityThread.java:150) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)Caused by java.lang.IllegalArgumentException: Service not registered: awx@ef02364 at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1044) at android.app.ContextImpl.unbindService(ContextImpl.java:1337) at android.content.ContextWrapper.unbindService(ContextWrapper.java:616) at com.google.android.gms.ads.internal.customtabs.a.a(:com.google.android.gms.DynamiteModulesA:69) at com.google.android.gms.ads.internal.mediation.customtabs.c.s(:com.google.android.gms.DynamiteModulesA:122) at com.google.android.gms.ads.internal.overlay.ab.n(:com.google.android.gms.DynamiteModulesA:714) at com.google.android.gms.ads.internal.overlay.ab.i(:com.google.android.gms.DynamiteModulesA:434) at com.google.android.gms.ads.internal.overlay.client.c.onTransact(:com.google.android.gms.DynamiteModulesA:86) at android.os.Binder.transact(Binder.java:387) at com.google.android.gms.internal.zzgz$zza$zza.onPause(Unknown Source) at com.google.android.gms.ads.AdActivity.onPause(Unknown Source) at android.app.Activity.performPause(Activity.java:6406) at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1312) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3367) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3340) at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3315) at android.app.ActivityThread.access$1100(ActivityThread.java:150) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1362) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Hello Vu,
Thank you for the follow up
Can you please speed up things?
Or apps are crashing out there and we are losing our users.
Please hurry up.
Best regards
Mohammad
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/jXQW4gwUEDs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/jXQW4gwUEDs/unsubscribe.
To unsubscribe from this group and all its topics, 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.
We do not inspect and log the local Play Services version. Since we deploy the app with 9.4.0, it seems like it would be worth the effort to assume this crash is happening on 9.4.0 and see if the stack track line numbers match up with the corresponding code base.
at club.androidy.callcontrolfree.Activities.MainActivity.onCreate(<span style="color:#60
java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.Map.containsKey(java.lang.Object)' on a null object reference
com.google.android.gms.ads.internal.formats.v.a(:com.google.android.gms.DynamiteModulesA:310)
com.google.android.gms.ads.internal.formats.w.run(:com.google.android.gms.DynamiteModulesA:3037)
android.os.Handler.handleCallback(Handler.java:815)
android.os.Handler.dispatchMessage(Handler.java:104)
android.os.Looper.loop(Looper.java:207)
android.app.ActivityThread.main(ActivityThread.java:5728)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)
We are now seeing a very sharp drop-off in occurrences of this crash, with no known change on our side.
On Wednesday, September 21, 2016 at 10:55:52 AM UTC-5, Mark McClelland wrote:
We do not inspect and log the local Play Services version. Since we deploy the app with 9.4.0, it seems like it would be worth the effort to assume this crash is happening on 9.4.0 and see if the stack track line numbers match up with the corresponding code base.
That stack trace points to a different crash. There is a fix for it and it will ship in a future release of the SDK. Once we approach the release, I should have more details.
at com.google.android.gms<span style="c
at com.google.android.gms.<sp
'com.google.android.gms:play-services-ads:11.0.0'
at com.google.android.gms.chimera.container.DynamiteLoaderImpl.getModuleVersion2(:</s