I’m using Firebase analytics. I’m investigating ANRs reported on Google Play, and it appears that the most frequent ones are associated with various receivers added by the Firebase analytics plugin to the Manifest.
Edit: I have various plugin configurations across my portfolio, and I’m trying to pin down why some apps have over 1% ANR rate while others have almost 0% ANR rate. First I thought it was related to Firebase, but that appears untrue. The posts below contain discussion.
Before proceeding, why is this important? As annouced at Google Playtime 2017, Google will start penalizing apps (using reduced ranking) which exhibit “Bad behaviour” as reported in the Android Vitals section of the dev console. For ANRs, the limit is 0.47% ANR rate, and I’m currently at 1.28%.
One of my most frequent ANRs is in executing service se.appfamily.superpuzzlefree/shared.google.play.services.base.PackageStateChangedService
native: pc 00000000000176a4 /system/lib/libc.so (syscall+28)
native: pc 00000000000401d5 /system/lib/libc.so (pthread_join+124)
native: pc 0000000000015b58 /data/app/se.appfamily.superpuzzlefree-1/lib/arm/libopenal.so (alcDestroyContext+516)
native: pc 0000000000008ed7 /data/app/se.appfamily.superpuzzlefree-1/lib/arm/libalmixer.so (ALmixer_Quit+230)
native: pc 000000000011d014 /data/app/se.appfamily.superpuzzlefree-1/lib/arm/libcorona.so (???)
native: pc 000000000011f448 /data/app/se.appfamily.superpuzzlefree-1/lib/arm/libcorona.so (???)
native: pc 000000000012f53c /data/app/se.appfamily.superpuzzlefree-1/lib/arm/libcorona.so (???)
native: pc 000000000002b6c4 /data/app/se.appfamily.superpuzzlefree-1/lib/arm/libcorona.so (???)
native: pc 000000000002e9c0 /data/app/se.appfamily.superpuzzlefree-1/lib/arm/libcorona.so (Java_com_ansca_corona_JavaToNativeShim_nativeDone+28)
native: pc 0000000000425af5 /data/app/se.appfamily.superpuzzlefree-1/oat/arm/base.odex (Java_com_ansca_corona_JavaToNativeShim_nativeDone__J+80)
at com.ansca.corona.JavaToNativeShim.nativeDone (Native method)
at com.ansca.corona.JavaToNativeShim.destroy (JavaToNativeShim.java:277) at com.ansca.corona.Controller.destroy (Controller.java:286) - locked <0x0a532824> (a com.ansca.corona.Controller) at com.ansca.corona.CoronaRuntime.dispose (CoronaRuntime.java:88) at com.ansca.corona.CoronaActivity.onDestroy (CoronaActivity.java:1679)
at android.app.Activity.performDestroy (Activity.java:7130)
at android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1171)
at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5126)
at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5171)
at android.app.ActivityThread.access$1700 (ActivityThread.java:230)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1881)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:7409)
at java.lang.reflect.Method.invoke! (Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
Doesn’t seem limited to any particular Android version:
To clarify my plugin uses a shared corona library. That error is from the corona shared library there is nothing I can do, you may want to file a bug report with them.
Thanks, I didn’t intend to cast any blame on the plugin itself, just highlight the consequences it has (for me, at least). There are multiple other ANRs pointing towards stuff related to Firebase, so I prefer to play safe and simply cease using it.
Turns out the offending line in the Manifest is also included if you use Admob (without Firebase). Original post edited, but not sure how to edit the title
We are not using Firebase or Admob but we still get a lot of the same ANRs for basically all our apps.
executing service com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle/shared.google.play.services.base.PackageStateChangedService "main" prio=5 tid=1 Native | group="main" sCount=1 dsCount=0 obj=0x73bc8e98 self=0xf3a05400 | sysTid=26481 nice=-4 cgrp=default sched=0/0 handle=0xf66b9534 | state=S schedstat=( 711107157 668022854 1857 ) utm=59 stm=12 core=2 HZ=100 | stack=0xff5b1000-0xff5b3000 stackSize=8MB | held mutexes= native: pc 0000000000017708 /system/lib/libc.so (syscall+28) native: pc 00000000000473bf /system/lib/libc.so (pthread\_join+146) native: pc 0000000000015b58 /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/lib/arm/libopenal.so (alcDestroyContext+516) native: pc 0000000000008ed7 /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/lib/arm/libalmixer.so (ALmixer\_Quit+230) native: pc 000000000011d48c /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/lib/arm/libcorona.so (???) native: pc 000000000011f8c0 /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/lib/arm/libcorona.so (???) native: pc 000000000012f9b4 /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/lib/arm/libcorona.so (???) native: pc 000000000002b6fc /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/lib/arm/libcorona.so (???) native: pc 000000000002e9f8 /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/lib/arm/libcorona.so (Java\_com\_ansca\_corona\_JavaToNativeShim\_nativeDone+28) native: pc 0000000000052415 /data/app/com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle-1/oat/arm/base.odex (Java\_com\_ansca\_corona\_JavaToNativeShim\_nativeDone\_\_J+80) at com.ansca.corona.JavaToNativeShim.nativeDone (Native method) at com.ansca.corona.JavaToNativeShim.destroy (JavaToNativeShim.java:277) at com.ansca.corona.Controller.destroy (Controller.java:286) - locked \<0x08356239\> (a com.ansca.corona.Controller) at com.ansca.corona.CoronaRuntime.dispose (CoronaRuntime.java:88) at com.ansca.corona.CoronaActivity.onDestroy (CoronaActivity.java:1732) at android.app.Activity.performDestroy (Activity.java:6907) at android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1154) at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:4267) at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:4298) at android.app.ActivityThread.-wrap6 (ActivityThread.java) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1576) at android.os.Handler.dispatchMessage (Handler.java:102) at android.os.Looper.loop (Looper.java:241) at android.app.ActivityThread.main (ActivityThread.java:6223) at java.lang.reflect.Method.invoke! (Native method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:755)
It would be great if Corona could fix this as soon as possible.
Joakim, what does your manifest look like? Possibly some other plugin (IAP?) also injects that service requirement? Maybe we’ll need to clean this up before filing bug report
FYI most native plugins use google play services in their app. Google play games service, any firebase plugin, google analytics, google iap, one signal, etc.
Using this thread to document findings/thoughts as I go
One app, Balloon Pop, uses Firebase and IAP. It has very few ANRs
Another app, Animal Memory, uses Firebase and IAP and Kidoz. It has around 1% ANRs
The biggest one, Super Puzzle, uses Firebase and IAP and Admob and Kidoz. Lots of ANRs.
For Super Puzzle, removing Firebase made no difference as far as I can tell. Which is in line with expectations, since Balloon Pop uses Firebase and is fine.
Now I’ll publish Super Puzzle without Admob (it isn’t used by default, but included in the build settings in case I want to enable it remotely). I’m keeping Kidoz in, but based on the Animal Memory app above (which has Kidoz but not Admob), the hypothesis is unfortunately that I’ll still see lots of ANRs.
(Trial and error, but there are plenty of daily installs so I get results quickly)
@perflubron: My ANRs skyrocketed after i started using Kidoz. Thanks to your thought/process of elimination i disabled (stopped using) Kidoz. I know you are discussing the issue with Kidoz. Any updated on this from them? The Kidoz plugin hasn’t been updated recently, so i’m guessing the sdk hasn’t changed either.
Is it the " executing service se.appfamily.superpuzzlefree/shared.google.play.services.base.PackageStateChangedService" that you are chasing? Solving that one would in my case get me on the right side of the threshold.
Yes. same ANR. And i ‘fixed’ it by disabling Kidoz. My app is ad free for the time being until this issue is resolved and Kidoz update their SDK.
By the way, am I correct in assuming that even if we fix ANRs and crashes, the threshold is calculated over a three months period? So, the app will remain ‘penalized’ for at least three months?
Thank you for this discussion, we would like to inform you that we are working with the Corona team who is responsible for the KIDOZ plugin to monitor and solve the issue asap, some fixes have been made and we hope to have new release of the KIDOZ plugin available in the coming days.
We will make sure to notify our partners directly as well as here in the forum once the new build is available.
In case of any questions, please reach out and contact us at sdk@kidoz.net.