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
It appears to happen when exiting the app:
“main” prio=5 tid=1 Native | group=“main” sCount=1 dsCount=0 obj=0x76918598 self=0xf4fe4500 | sysTid=21370 nice=-4 cgrp=default sched=0/0 handle=0xf77cad54 | state=S schedstat=( 0 0 0 ) utm=39 stm=41 core=5 HZ=100 | stack=0xff1a1000-0xff1a3000 stackSize=8MB | held mutexes=
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:
Android 6.0 13,171 57.0% Android 7.0 6,992 30.3% Android 5.1 1,668 7.2% Android 7.1 733 3.2% Android 5.0 529 2.3% Android 8.0 18 0.1%
Afraid I don’t have a reproducible case.