AppMeasurementInstallReferrerReceiver causes many ANR with FirebaseAnalytics - android

I recently updated to
implementation 'com.google.firebase:firebase-analytics:17.2.3'
which is adding AppMeasurementInstallReferrerReceiver to my app manifest.xml just like this https://developers.google.com/android/reference/com/google/android/gms/measurement/AppMeasurementInstallReferrerReceiver
Since then, I'm having a lot (almost 5 per hour) of :
Broadcast of Intent { act=com.android.vending.INSTALL_REFERRER flg=0x10 pkg=my.app
cmp=my.app/com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver (has extras) }
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x766f4ce8 self=0x7a52814c00
| sysTid=9106 nice=0 cgrp=default sched=0/0 handle=0x7ad934d560
| state=S schedstat=( 9992336593 1304413016 9382 ) utm=658 stm=341 core=0 HZ=100
| stack=0x7fd7055000-0x7fd7057000 stackSize=8MB
| held mutexes=
#00 pc 000000000007c600 /system/lib64/libc.so (__epoll_pwait+8)
#01 pc 0000000000014d48 /system/lib64/libutils.so (android::Looper::pollInner(int)+148)
#02 pc 0000000000014c18 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+60)
#03 pc 0000000000130028 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44)
at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
at android.os.MessageQueue.next (MessageQueue.java:326)
at android.os.Looper.loop (Looper.java:181)
at android.app.ActivityThread.main (ActivityThread.java:7094)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)
Is there something I can do for it or should I just wait for an update from Firebase...

Related

Firebase cloud messagin causes ANR

I've an app in production with over 10k daily users
2% of the sessions are being reported as ANR due:
Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x11000010 pkg=com.tomatedigital.app
cmp=com.tomatedigital.app/com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) }
I've checked many sources nobody come with a real solution for that.
this link: https://github.com/firebase/quickstart-android/issues/594 starts with a good talking but as always firebase boys "burn out" and stop answering.
all the reports show something like:
"main" tid=1 Native
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x73be7718 self=0xeeaf7000
| sysTid=12027 nice=-4 cgrp=default sched=0/0 handle=0xf2fc54bc
| state=S schedstat=( 1058569940 1464725264 2305 ) utm=68 stm=37 core=2 HZ=100
| stack=0xff45f000-0xff461000 stackSize=8MB
| held mutexes=
#00 pc 000000000004a154 /system/lib/libc.so (__epoll_pwait+20)
#01 pc 000000000001b799 /system/lib/libc.so (epoll_pwait+60)
#02 pc 000000000001b7c9 /system/lib/libc.so (epoll_wait+12)
#03 pc 0000000000010343 /system/lib/libutils.so (android::Looper::pollInner(int)+118)
#04 pc 0000000000010235 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+32)
#05 pc 00000000000e10ed /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int)+24)
#06 pc 00000000001a6aed /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+92)
at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
at android.os.MessageQueue.next (MessageQueue.java:325)
at android.os.Looper.loop (Looper.java:142)
at android.app.ActivityThread.main (ActivityThread.java:6942)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
I'm really not sure what to do to solve it.
These are my firebase imports
implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.google.firebase:firebase-database:19.5.0'
implementation 'com.google.firebase:firebase-auth:19.4.0'
implementation 'com.google.firebase:firebase-dynamic-links:19.1.1'
implementation 'com.google.firebase:firebase-messaging:20.3.0'
implementation 'com.google.firebase:firebase-config:19.2.0'

HeapTaskDaemon blocked ANR. Other threads seem to be in waiting state

We have an ANR where the HeapTaskDaemon is blocked and the main thread is waiting and not busy/blocked. There are no parts of our code in any of the threads. How to debug this ANR? From what I see there is no deadlock and nothing heavy is being done on the main thread.
It also doesn't seem to be a long running operation in an INTENT.
Any trips on understanding the ANR would be really helpful. Also what does HeapTaskDaemon waiting to lock unknown object mean ?
Here is the HeapTaskDaemon thread:
HeapTaskDaemon" daemon prio=5 tid=6 Blocked
| group="system" sCount=1 dsCount=0 flags=1 obj=0x140c0338 self=0xa41d1400
| sysTid=1239 nice=4 cgrp=default sched=0/0 handle=0x99e3b970
| state=S schedstat=( 0 0 0 ) utm=515 stm=86 core=1 HZ=100
| stack=0x99d39000-0x99d3b000 stackSize=1038KB
| held mutexes=
#00 pc 000000000001902c /system/lib/libc.so (syscall+28)
#01 pc 00000000000b7289 /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88)
#02 pc 00000000001cc795 /system/lib/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+284)
#03 pc 00000000001ccd75 /system/lib/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+44)
#04 pc 00000000000551e3 /system/framework/arm/boot-core-libart.oat (Java_dalvik_system_VMRuntime_runHeapTasks__+74)
at dalvik.system.VMRuntime.runHeapTasks (Native method)
- waiting to lock an unknown object
at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:461)
at java.lang.Daemons$Daemon.run (Daemons.java:103)
at java.lang.Thread.run (Thread.java:764)
Main Thread:
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x70cb3f08 self=0xac6a8000
| sysTid=1230 nice=-2 cgrp=default sched=0/0 handle=0xb07a64a4
| state=S schedstat=( 0 0 0 ) utm=2107 stm=662 core=1 HZ=100
| stack=0xbe6e0000-0xbe6e2000 stackSize=8MB
| held mutexes=
#00 pc 0000000000049658 /system/lib/libc.so (__epoll_pwait+20)
#01 pc 000000000001b7b5 /system/lib/libc.so (epoll_pwait+60)
#02 pc 000000000001b7e5 /system/lib/libc.so (epoll_wait+12)
#03 pc 000000000001008b /system/lib/libutils.so (android::Looper::pollInner(int)+118)
#04 pc 000000000000ff7d /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+32)
#05 pc 00000000000b2d0d /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int)+24)
#06 pc 00000000000ba5d5 /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+92)
at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
at android.os.MessageQueue.next (MessageQueue.java:325)
at android.os.Looper.loop (Looper.java:142)
at com.android.server.SystemServer.run (SystemServer.java:423)
at com.android.server.SystemServer.main (SystemServer.java:274)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:787)
The full ANR log is at https://pastebin.com/i4F4VgTS

Facebook Android SDK 5.4.0 causing ANRs after update

After updating the Facebook SDK version from 4.40.0 to 5.4.0, my app is getting a ton of ANRs. 12k ANRs in one day, the users couldn't even open the app.
Full Stack trace:
"main" prio=5 tid=1 Waiting
| group="main" sCount=1 dsCount=0 obj=0x7496b268 self=0xb2c84400
| sysTid=8451 nice=0 cgrp=default sched=0/0 handle=0xb5b72534
| state=S schedstat=( 0 0 0 ) utm=12 stm=7 core=2 HZ=100
| stack=0xbe6c2000-0xbe6c4000 stackSize=8MB
| held mutexes=
at java.lang.Object.wait (Native method)
- waiting on <0x047bbe7f> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:2127)
- locked <0x047bbe7f> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:161)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt (AbstractQueuedSynchronizer.java:840)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly (AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly (AbstractQueuedSynchronizer.java:1303)
at java.util.concurrent.CountDownLatch.await (CountDownLatch.java:203)
at com.facebook.internal.LockOnGetVariable.waitOnInit (LockOnGetVariable.java:64)
at com.facebook.internal.LockOnGetVariable.getValue (LockOnGetVariable.java:54)
at com.facebook.FacebookSdk.getCacheDir (FacebookSdk.java:954)
at com.facebook.internal.instrument.InstrumentUtility.getInstrumentReportDir (InstrumentUtility.java:242)
at com.facebook.internal.instrument.InstrumentUtility.listCrashReportFiles (InstrumentUtility.java:124)
at com.facebook.internal.instrument.crashreport.CrashHandler.sendCrashReports (CrashHandler.java:101)
at com.facebook.internal.instrument.crashreport.CrashHandler.enable (CrashHandler.java:73)
- locked <0x01f4fe4c> (a java.lang.Class<com.facebook.internal.instrument.crashreport.CrashHandler>)
at com.facebook.internal.instrument.InstrumentManager.start (InstrumentManager.java:46)
at com.facebook.FacebookSdk.sdkInitialize (FacebookSdk.java:326)
- locked <0x05939e95> (a java.lang.Class<com.facebook.FacebookSdk>)
at com.facebook.marketing.internal.MarketingInitProvider.onCreate (MarketingInitProvider.java:42)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1753)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1728)
at android.app.ActivityThread.installProvider (ActivityThread.java:6066)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:5658)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5597)
at android.app.ActivityThread.-wrap2 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1614)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6351)
at java.lang.reflect.Method.invoke! (Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:896)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:786)
"GoogleApiHandler" tid=22 Native
"GoogleApiHandler" prio=5 tid=22 Native
| group="main" sCount=1 dsCount=0 obj=0x22c0caf0 self=0xab5c6700
| sysTid=8512 nice=9 cgrp=default sched=0/0 handle=0x95332920
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=1 HZ=100
| stack=0x95230000-0x95232000 stackSize=1038KB
| held mutexes=
#00 pc 0000000000048e38 /system/lib/libc.so (__epoll_pwait+20)
#01 pc 000000000001a291 /system/lib/libc.so (epoll_pwait+60)
#02 pc 000000000001a2c1 /system/lib/libc.so (epoll_wait+12)
#03 pc 0000000000011e77 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+118)
#04 pc 0000000000011d73 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+26)
#05 pc 0000000000096fbd /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
#06 pc 000000000067f0a5 /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+96)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:323)
at android.os.Looper.loop (Looper.java:136)
at android.os.HandlerThread.run (HandlerThread.java:61)
"TokenRefresher" tid=23 Native
"TokenRefresher" prio=5 tid=23 Native
| group="main" sCount=1 dsCount=0 obj=0x22c0cb80 self=0xab5c5d00
| sysTid=8513 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0x9573c920
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2 HZ=100
| stack=0x9563a000-0x9563c000 stackSize=1038KB
| held mutexes=
#00 pc 0000000000048e38 /system/lib/libc.so (__epoll_pwait+20)
#01 pc 000000000001a291 /system/lib/libc.so (epoll_pwait+60)
#02 pc 000000000001a2c1 /system/lib/libc.so (epoll_wait+12)
#03 pc 0000000000011e77 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+118)
#04 pc 0000000000011d73 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+26)
#05 pc 0000000000096fbd /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
#06 pc 000000000067f0a5 /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+96)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:323)
at android.os.Looper.loop (Looper.java:136)
at android.os.HandlerThread.run (HandlerThread.java:61)
I downgraded to version 4.40.0 and the issue has been resolved, but Facebook is constantly sending me alerts to update the SDK, how to solve? I lost thousands of users and several negative reviews.
The Facebook team noticed the issue and fixed it in version 5.5.0.
Commit: https://github.com/facebook/facebook-android-sdk/commit/856665c5e0ede060b3a0f18af8a808aba26d4778

ANR com.android.vending.billing.IInAppBillingService

Ever since modifying my code to use the Android billing library instead of the old IABHelper from the sample app, I have been getting a lot of ANRs with this trace below. Anyone have any idea how to solve that? there isn't a single line of my code on the trace.
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x73b53ac0 self=0x77558a3a00
| sysTid=17097 nice=0 cgrp=default sched=0/0 handle=0x775a8109b0
| state=S schedstat=( 21526708836 9207381756 40660 ) utm=1497 stm=655 core=5 HZ=100
| stack=0x7ff197c000-0x7ff197e000 stackSize=8MB
| held mutexes=
#00 pc 000000000001da2c /system/lib64/libc.so (syscall+28)
#01 pc 00000000000e1ee4 /system/lib64/libart.so (_ZN3art17ConditionVariable16WaitHoldingLocksEPNS_6ThreadE+152)
#02 pc 00000000004e35c8 /system/lib64/libart.so (_ZN3artL12GoToRunnableEPNS_6ThreadE+440)
#03 pc 00000000004e33c8 /system/lib64/libart.so (_ZN3art12JniMethodEndEjPNS_6ThreadE+28)
#04 pc 000000000098a7bc /system/framework/arm64/boot-framework.oat (Java_android_os_BinderProxy_transactNative__ILandroid_os_Parcel_2Landroid_os_Parcel_2I+220)
at android.os.BinderProxy.transactNative (Native method)
at android.os.BinderProxy.transact (Binder.java:751)
at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupported (IInAppBillingService.java:320)
at com.android.billingclient.api.BillingClientImpl$BillingServiceConnection.onServiceConnected (BillingClientImpl.java:839)
at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1818)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1847)
at android.os.Handler.handleCallback (Handler.java:808)
at android.os.Handler.dispatchMessage (Handler.java:101)
at android.os.Looper.loop (Looper.java:166)
at android.app.ActivityThread.main (ActivityThread.java:7425)
at java.lang.reflect.Method.invoke (Native method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
Appears to be an issue with the Play Store reading a file on the UI thread https://issuetracker.google.com/issues/123117066

ANR on Google's billing library

Anyone have any idea why this ANR might be happening? I thought upgrading from the old IABHelper to the new billing library would solve it but it didn't. I submitted a bug on the billing library sample on github but haven't heard anything.
This is happening on Android 7 and 8. I have never had it happen to me, I only see it on the Play Store console.
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x73ad8e30 self=0x7d456c7a00
| sysTid=21462 nice=0 cgrp=default sched=0/0 handle=0x7d4a0fd9b0
| state=S schedstat=( 0 0 0 ) utm=2078 stm=1145 core=2 HZ=100
| stack=0x7ff79b5000-0x7ff79b7000 stackSize=8MB
| held mutexes=
#00 pc 000000000001de2c /system/lib64/libc.so (syscall+28)
#01 pc 00000000000e1a5c /system/lib64/libart.so (_ZN3art17ConditionVariable16WaitHoldingLocksEPNS_6ThreadE+152)
#02 pc 00000000004e12c4 /system/lib64/libart.so (_ZN3artL12GoToRunnableEPNS_6ThreadE+440)
#03 pc 00000000004e10c4 /system/lib64/libart.so (_ZN3art12JniMethodEndEjPNS_6ThreadE+28)
#04 pc 0000000000987c3c /system/framework/arm64/boot-framework.oat (Java_android_os_BinderProxy_transactNative__ILandroid_os_Parcel_2Landroid_os_Parcel_2I+220)
at android.os.BinderProxy.transactNative (Native method)
at android.os.BinderProxy.transact (Binder.java:766)
at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupported (IInAppBillingService.java:320)
at com.android.billingclient.api.BillingClientImpl$BillingServiceConnection.onServiceConnected (BillingClientImpl.java:839)
at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1713)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1742)
at android.os.Handler.handleCallback (Handler.java:789)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6703)
at java.lang.reflect.Method.invoke (Native method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:769)

Categories

Resources