Unable to pause activity {com.google.android.gms.ads.AdActivity}

909 views
Skip to first unread message

Đôn Nguyễn

unread,
Sep 7, 2016, 10:44:59 PM9/7/16
to Google Mobile Ads SDK Developers
The issue is happening quite frequently on our production app. Can you please take a look.
Here is the full stack trace:

Fatal Exception: java.lang.RuntimeException: Unable to pause activity {removed/com.google.android.gms.ads.AdActivity}: java.lang.IllegalArgumentException: Service not registered: aqy@2e4d3f80
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3366)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3325)
       at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3300)
       at android.app.ActivityThread.access$1000(ActivityThread.java:156)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1369)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:211)
       at android.app.ActivityThread.main(ActivityThread.java:5371)
       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:945)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:740)
Caused by java.lang.IllegalArgumentException: Service not registered: aqy@2e4d3f80
       at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1035)
       at android.app.ContextImpl.unbindService(ContextImpl.java:1829)
       at android.content.ContextWrapper.unbindService(ContextWrapper.java:551)
       at com.google.android.gms.ads.internal.customtabs.a.a(:com.google.android.gms.DynamiteModulesA:72)
       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:715)
       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:380)
       at com.google.android.gms.internal.zzhi$zza$zza.onPause(Unknown Source)
       at com.google.android.gms.ads.AdActivity.onPause(Unknown Source)
       at android.app.Activity.performPause(Activity.java:6101)
       at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1310)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3352)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3325)
       at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3300)
       at android.app.ActivityThread.access$1000(ActivityThread.java:156)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1369)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:211)
       at android.app.ActivityThread.main(ActivityThread.java:5371)
       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:945)

Not sure if I am right to post this issue here because I am using com.google.firebase:firebase-ads

Thanks for you help!

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 8, 2016, 10:30:18 AM9/8/16
to Google Mobile Ads SDK Developers
Hi Đôn,

There might be several possibilities to this crash and I would suggest you the following - 
  • Are you trying to load any of our AdViews from a worker thread? If so, this is not something that you must be doing. Always make sure that you are making the AdRequest from the main thread.
  • Are you handling Runtime changes? Your activity can destroy and restart itself if you are not handling them. Make sure that you have added configChanges in your Manifest.
  • I'm assuming that this is an Interstitial. If so, can you try to reproduce with our sample apps? If not, do send us some code snippets or a minified version of your sample app and we will have a look into this further.
Thanks,
Arjun Busani
Mobile Ads SDK Team

Тимофей Крючков

unread,
Sep 18, 2016, 2:23:29 AM9/18/16
to Google Mobile Ads SDK Developers
Good day! I have same problem with Interstitial ads last month. Manifest same like you adviced. 
Different Android versions - 6.0.1, 5.1, 5.1.1, 6.0, 4.2.2
It reproduced not every time, but I see it time by time in Crashlytics during last month.
More than one year before that there was no such errors. The problem is reproduced in many applications in which there were no changes in the past six months


четверг, 8 сентября 2016 г., 17:30:18 UTC+3 пользователь Veer Arjun Busani(Mobile Ads SDK Team) написал:

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 19, 2016, 10:32:00 AM9/19/16
to Google Mobile Ads SDK Developers
Hi Тимофей,

I'm going to assume that it is an implementation issue and would like to ask you to try and reproduce this with our sample apps. What is interesting from the stack trace is the performPauseActivity. Can you send us a minified version of your app or some code snippets? We would love to debug this issue.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Тимофей Крючков

unread,
Sep 24, 2016, 1:29:21 AM9/24/16
to Google Mobile Ads SDK Developers
Hi! Here is my sample code:

I try to show Interstitial when user leave current screen (Activity):
@Override
public void onBackPressed() {
showInterstitial();
finish();
}

Also I tried use with same result:
@Override
public void onBackPressed() {
showInterstitial();
super.onBackPressed();
}

The problem is not reproduced every time, but in the last month - every day several times (the total number of impressions per day 20000 ads)

понедельник, 19 сентября 2016 г., 17:32:00 UTC+3 пользователь Veer Arjun Busani(Mobile Ads SDK Team) написал:

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 26, 2016, 10:24:01 AM9/26/16
to Google Mobile Ads SDK Developers
Hi Тимофей,

I would not recommend this implementation, where you are presenting the Interstitial and also calling super.onBackPressed() or calling finish(). Instead, if you want to show an Interstitial when the user clicks the back button, have a flag in the onBackPressed() function, present the Interstitial and once the Interstitial is dismissed, call the finish() method from the onAdClosed() delegate method. Simply wait till the Interstitial is dismissed to go back to the previous activity. 

Thanks,
Arjun Busani
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages