Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Exception : LoadedApk:forgetServiceDispatcher:888 {AdWorker #2

I am facing a bug with my latest app for Android. I am using latest Google Play Services v. 4 and think that it is the culprit for the following error I get on some phones. I get many reports for this kind of errors : IllegalArgumentException (@LoadedApk:forgetServiceDispatcher:888) {AdWorker #2}

The error details from reports from users are those :

java.lang.IllegalArgumentException: Service not registered: ano@407dc868
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:891)
at android.app.ContextImpl.unbindService(ContextImpl.java:906)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:352)
at ta.a(SourceFile:135)
at qc.d(SourceFile:88)
at qc.b(SourceFile:129)
at pz.a(SourceFile:239)
at pz.a(SourceFile:176)
at wd.a(SourceFile:112)
at xf.run(SourceFile:14)
at xh.run(SourceFile:30)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)

I can't understand what goes wrong, since my app does not use any services at all except for the google play services.

Any ideas?

like image 775
Nick Avatar asked Dec 17 '13 15:12

Nick


2 Answers

After a lot of experimentation I think that I finally found the solution. The culprit seems to be Admob and more specifically Interstitial ads from latest Admob library on Google Play Services.

I had one Interstitial ad to show up when user was leaving the application. I had another one to show up when he was leaving one specific Activity. That caused the error. On the first case application was closing and the Interstitial was still working to load the ad and that was causing the error. On the other case activity was closing and ad was still loading and that was causing problems on some phones.

Solution : I moved all Interestitial ad loading or showing when activity starts and now everything works fine. Ofcourse I removed the ad showing when user exits the app.

Hope that helps, it took me two days to figure it out!

like image 170
Nick Avatar answered Nov 15 '22 00:11

Nick


Seems like this is introduced by firebase-core package version 20+. However, this doesn't seem like an actual issue or a crash. With this also the app keeps working fine both in debug and release mode. For now there is no fix for it except to live with it or to downgrade the version to belo 20.

More discussions on this github page.

like image 1
Sisir Avatar answered Nov 14 '22 23:11

Sisir