Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANR from crashlytics related to Firebase #4345

Closed
ItsBenyaamin opened this issue Nov 19, 2022 · 108 comments
Closed

ANR from crashlytics related to Firebase #4345

ItsBenyaamin opened this issue Nov 19, 2022 · 108 comments
Assignees
Labels
api: crashlytics priority: p2 triaged-accepted Triaged planned to fix in a future release

Comments

@ItsBenyaamin
Copy link

ItsBenyaamin commented Nov 19, 2022

[REQUIRED] Step 2: Describe your environment

Versions:

    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'

    implementation 'com.google.firebase:firebase-crashlytics-ktx:18.3.2'
    implementation 'com.google.firebase:firebase-analytics-ktx:21.2.0'

[REQUIRED] Step 3: Describe the problem

image

We facing this issue for almost 3 months now. But recently the ANR count is insanely high as you can see in the above
From crashlytics:

main (timed waiting):tid=1 systid=19557 
       at jdk.internal.misc.Unsafe.park(Unsafe.java)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369)
       at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
       at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:22)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:94)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:94)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:26)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
       at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)

Relevant Code:

// TODO(you): code here to reproduce the problem
@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@argzdev
Copy link
Contributor

argzdev commented Nov 22, 2022

Hi @graymind75, thanks for reporting. Are you using any code related to Crashlytics? Also were there any changes related to Firebase prior to this issue happening?

@ItsBenyaamin
Copy link
Author

No, It's just initializing with FirebaseApp.initializeApp(applicationContext)

@argzdev
Copy link
Contributor

argzdev commented Nov 23, 2022

Thanks for the details, @graymind75. While we investigate this. Just to confirm, were you using a prior version of Crashlytics before experiencing this issue? If yes, could you share which version were you using?

@ItsBenyaamin
Copy link
Author

Hi, Sorry I forgot to put the versions

before any problem:
    classpath:      2.9.0
    crashlytics:    18.2.11
    analytics:       21.0.0

first ANR:
    classpath:      2.9.1
    crashlytics:    18.2.12
    analytics:       21.1.0

and the devices ANR submitted from:
Screenshot from 2022-11-24 17-56-25

@marcelpallares
Copy link

marcelpallares commented Dec 22, 2022

Hi, we are facing the same ANR being reported twice with different logs:

main (timed waiting):tid=1 systid=27674 
       at sun.misc.Unsafe.park(Unsafe.java)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1063)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1358)
       at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
       at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java)
       at com.google.firebase.crashlytics.internal.Logger.canLog(Logger.java)
       at com.facebook.internal.instrument.InstrumentUtility.isSDKRelatedException(InstrumentUtility.java)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
       at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
main (timed waiting):tid=1 systid=23250 
       at jdk.internal.misc.Unsafe.park(Unsafe.java)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369)
       at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
       at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:22)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:93)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:93)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:25)
       at com.facebook.internal.instrument.crashreport.CrashHandler.uncaughtException(CrashHandler.java:409)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
       at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)

We use Crashlytics too and the versions are the ones that come with Firebase BOM 31.1.0.
We are just upgrading to 31.1.1 but won't have data until the next release which will be at some point in January.

They are our top ANRs, here are the stats of the last 30 days:

CleanShot 2022-12-22 at 14 09 35@2x

CleanShot 2022-12-22 at 14 01 48@2x

CleanShot 2022-12-22 at 14 09 01@2x

@himanshuoyo
Copy link

Same occurred to us as well with below logs:
main (timed waiting):tid=1 systid=32460 at jdk.internal.misc.Unsafe.park(Unsafe.java) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278) at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:124) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.checkForPreviousCrash(CrashlyticsCore.java:485) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:184) at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:149) at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:60) at com.google.firebase.crashlytics.CrashlyticsRegistrar.$r8$lambda$Pfd5XmDCFzNyAT9o9H6rDnTBQE4(CrashlyticsRegistrar.java) at com.google.firebase.crashlytics.CrashlyticsRegistrar$$InternalSyntheticLambda$3$ab347a8933944304e42539e3f0bc7a2eb5ded1d56c7a52feedae47ac52780cf7$0.create(CrashlyticsRegistrar.java:2) at com.google.firebase.tracing.ComponentMonitor.lambda$processRegistrar$0(ComponentMonitor.java:38) at com.google.firebase.tracing.ComponentMonitor.$r8$lambda$nUgWIWAyyZxi6mRt6KSZMmA5LxE(ComponentMonitor.java) at com.google.firebase.tracing.ComponentMonitor$$InternalSyntheticLambda$3$5d14153249ab9155b8414252ecf49149174a086fa7b21bebac19047e371b22f6$0.create(ComponentMonitor.java:4) at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:140) at com.google.firebase.components.ComponentRuntime.$r8$lambda$4FqOW9eOQsvFYo-HpMfxCOnPQr0(ComponentRuntime.java) at com.google.firebase.components.ComponentRuntime$$InternalSyntheticLambda$2$784536aca87f12f75d3504e86fd606a2ca102f8312a2daf2c8c51b9b25617f63$0.get(ComponentRuntime.java:4) at com.google.firebase.components.Lazy.get(Lazy.java:53) at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:302) at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:292) at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:605) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:307) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:271) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:256) at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:2404) at android.content.ContentProvider.attachInfo(ContentProvider.java:2374) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45) at android.app.ActivityThread.installProvider(ActivityThread.java:7459) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6976) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6747) at android.app.ActivityThread.access$1500(ActivityThread.java:256) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2091) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7870) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Firebase BOM Version - 31.0.2

@himanshuoyo
Copy link

Same occurred to us as well with below logs: main (timed waiting):tid=1 systid=32460 at jdk.internal.misc.Unsafe.park(Unsafe.java) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278) at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:124) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.checkForPreviousCrash(CrashlyticsCore.java:485) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:184) at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:149) at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:60) at com.google.firebase.crashlytics.CrashlyticsRegistrar.$r8$lambda$Pfd5XmDCFzNyAT9o9H6rDnTBQE4(CrashlyticsRegistrar.java) at com.google.firebase.crashlytics.CrashlyticsRegistrar$$InternalSyntheticLambda$3$ab347a8933944304e42539e3f0bc7a2eb5ded1d56c7a52feedae47ac52780cf7$0.create(CrashlyticsRegistrar.java:2) at com.google.firebase.tracing.ComponentMonitor.lambda$processRegistrar$0(ComponentMonitor.java:38) at com.google.firebase.tracing.ComponentMonitor.$r8$lambda$nUgWIWAyyZxi6mRt6KSZMmA5LxE(ComponentMonitor.java) at com.google.firebase.tracing.ComponentMonitor$$InternalSyntheticLambda$3$5d14153249ab9155b8414252ecf49149174a086fa7b21bebac19047e371b22f6$0.create(ComponentMonitor.java:4) at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:140) at com.google.firebase.components.ComponentRuntime.$r8$lambda$4FqOW9eOQsvFYo-HpMfxCOnPQr0(ComponentRuntime.java) at com.google.firebase.components.ComponentRuntime$$InternalSyntheticLambda$2$784536aca87f12f75d3504e86fd606a2ca102f8312a2daf2c8c51b9b25617f63$0.get(ComponentRuntime.java:4) at com.google.firebase.components.Lazy.get(Lazy.java:53) at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:302) at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:292) at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:605) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:307) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:271) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:256) at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:2404) at android.content.ContentProvider.attachInfo(ContentProvider.java:2374) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45) at android.app.ActivityThread.installProvider(ActivityThread.java:7459) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6976) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6747) at android.app.ActivityThread.access$1500(ActivityThread.java:256) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2091) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7870) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Firebase BOM Version - 31.0.2

Even after upgrading to BOM Version - 31.1.1 still the same.

@arlindiDev
Copy link

Is there any update on this issue, we are also facing a large volume of ANRs.

@Julesssss
Copy link

We're seeing a similar issue with Firebase BOM 31.1.1:

main (native):tid=1 systid=7347 
#00 pc 0xa76bc libc.so (__rt_sigsuspend + 12)
#01 pc 0x631cc libc.so (sigsuspend + 56)
#02 pc 0x5c14a8 split_config.arm64_v8a.apk 
#03 pc 0x89c [vdso] 
#04 pc 0xa7cb8 libc.so (__epoll_pwait + 8)
#05 pc 0x17cc0 libutils.so (android::Looper::pollInner(int) + 192)
#06 pc 0x17b9c libutils.so (android::Looper::pollOnce(int, int*, int*, void**) + 116)
#07 pc 0x1687b0 libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int) + 48)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:186)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8741)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
awaitEvenIfOnMainThread task continuation executor1 (waiting):tid=23 systid=7448 
       at jdk.internal.misc.Unsafe.park(Unsafe.java)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
       at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:64)
       at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:27)
       at java.lang.Thread.run(Thread.java:1012)

@mrober
Copy link
Contributor

mrober commented Feb 1, 2023

We are aware of this issue. We have some work planned that will reduce the load on the main thread, which should resolve this issue as well. I will keep this thread updated.

@slott
Copy link

slott commented Feb 8, 2023

The issue started to surface roughly one year ago - surely you have the resources to do more than just "should resolve...".

This is a product used by millions world wide and it really should get a higher priority.

@Julesssss
Copy link

Julesssss commented Feb 10, 2023

Hey @mrober, we appreciate the update.

While we await a resolution, are you able to provide any workarounds to prevent this from occurring in the meantime? For example, temporarily disabling Firebase Analytics/Crashlytics? Any information would be useful, as we currently have an ANR rate that is 4X the PlayStore quality bar.

@nes123
Copy link

nes123 commented Feb 10, 2023

Hey @mrober, we appreciate the update.

While we await a resolution, are you able to provide any workarounds to prevent this from occurring in the meantime? For example, temporarily disabling Firebase Analytics? Any information would be useful, as we currently have an ANR rate that is 4X the PlayStore quality bar.

is the problem with crashlytics or analytics?

@karthikeyan1241997
Copy link

Same for me too.

Stacktrace:

Thread-30087 (waiting):tid=272 systid=18410 
       at jdk.internal.misc.Unsafe.park(Native method)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:885)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1039)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
       at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232)
       at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:128)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:229)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:151)
       at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:55)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
       at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)

@shuaibimran
Copy link

@mrober please answer, In case a permanent solution will take some time, Do you have any temporary solution ?

@mrober mrober assigned themiswang and unassigned mrober Mar 13, 2023
@ankit92
Copy link

ankit92 commented Aug 1, 2024

Hi @mrober,
com.google.android.datatransport/transport-runtime library is using JobScheduler which is not recommended now as mentioned in android documentation: https://developer.android.com/about/versions/14/behavior-changes-14

_JobScheduler reinforces callback and network behavior
Since its introduction, JobScheduler expects your app to return from onStartJob or onStopJob within a few seconds. Prior to Android 14, if a job runs too long, it stops and fails silently. If your app targets Android 14 (API level 34) or higher and exceeds the granted time on the main thread, the app triggers an ANR with the error message "No response to onStartJob" or "No response to onStopJob". Consider migrating to WorkManager, which provides support for asynchronous processing or migrating any heavy work into a background thread._

All ANR's which spiked in our app are on Android 14 , as mentioned in above chat threads, and mostly related JobScheduler.

Strangely 75% of events are on OnePlus devices and rest 25% are on OPPO devices

Here are the logs:

art::ConditionVariable::WaitHoldingLocks
ANR triggered by thread waiting for a binder transaction

main (native)
tid=1 systid=30996
Triggered ANR
Root blocking
0
libc.so
syscall + 28
1
libart.so
art::ConditionVariable::WaitHoldingLocks + 140
2
libart.so
artJniMethodEnd + 336
3
libart.so
art_jni_method_end + 12
android.os.BinderProxy.transactNative (Native method)
This Binder call may be taking too long, causing the main thread to wait, and triggering the ANR.
android.os.BinderProxy.transact (BinderProxy.java:685)
android.app.job.IJobCallback$Stub$Proxy.acknowledgeStartMessage (IJobCallback.java:434)
android.app.job.JobServiceEngine$JobHandler.ackStartMessage (JobServiceEngine.java:384)
android.app.job.JobServiceEngine$JobHandler.handleMessage (JobServiceEngine.java:196)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loopOnce (Looper.java:257)
android.os.Looper.loop (Looper.java:368)
android.app.ActivityThread.main (ActivityThread.java:8839)
java.lang.reflect.Method.invoke (Native method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:572)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1049)

This is becoming more critical now and shaken all our app's performance metrics in terms of ANR's

Raised this to help you so that you can get more insights and request you to please provide us with the fix as soon as possible .
Thanks

@park671
Copy link

park671 commented Aug 2, 2024

#6145

@Krishnasony
Copy link

@mrober @argzdev , suddenly below ANR spiked exponentially on Android 14 after we upgraded our app to target android 14: [libart.so] art::ConditionVariable::WaitHoldingLocks ANR triggered by thread waiting for a binder transaction

Logs:

#00 pc 0x0000000000099000 /apex/com.android.runtime/lib64/bionic/libc.so (syscall+32) #1 pc 0x000000000023247c /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+140) #2 pc 0x000000000045b218 /apex/com.android.art/lib64/libart.so (artJniMethodEnd+336) #3 pc 0x00000000005bf0fc /apex/com.android.art/lib64/libart.so (art_jni_method_end+12) at android.os.BinderProxy.transactNative (Native method) This Binder call may be taking too long, causing the main thread to wait, and triggering the ANR. Learn more

at android.os.BinderProxy.transact (BinderProxy.java:685) at android.app.job.IJobCallback$Stub$Proxy.acknowledgeStartMessage (IJobCallback.java:434) at android.app.job.JobServiceEngine$JobHandler.ackStartMessage (JobServiceEngine.java:384) at android.app.job.JobServiceEngine$JobHandler.handleMessage (JobServiceEngine.java:196) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:257) at android.os.Looper.loop (Looper.java:368) at android.app.ActivityThread.main (ActivityThread.java:8839) at java.lang.reflect.Method.invoke (Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:572) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1049)

One More Example Logs:

com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService.onStartJob ANR triggered by slow operations in main thread

at android.os.BaseBundle.unparcel (BaseBundle.java:316) at android.os.BaseBundle.unparcel (BaseBundle.java:311) at android.os.BaseBundle.getString (BaseBundle.java:1415) at com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService.onStartJob (JobInfoSchedulerService.java:32) at android.app.job.JobService$1.onStartJob (JobService.java:106) at android.app.job.JobServiceEngine$JobHandler.handleMessage (JobServiceEngine.java:195) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:257) at android.os.Looper.loop (Looper.java:368) at android.app.ActivityThread.main (ActivityThread.java:8819) at java.lang.reflect.Method.invoke (Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:572) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1049)

Kindly assist. Lot of users are complaining

Is this solved?, I'm also getting this ANR after android 14 migration

@shawn-lin-013
Copy link

Hi @mrober, Is there a release schedule? Our ANR rate is getting worse now. 😢 Thanks

@ankit92
Copy link

ankit92 commented Aug 29, 2024

Hi @mrober , Any update on this? Also seeking update on #6147.

@mattrob33
Copy link

Seeing this on BOM 33.1.1

@shawn-lin-013
Copy link

Hi @mrober and @themiswang, It's been a few weeks, are there any new updates?

@mrober
Copy link
Contributor

mrober commented Sep 12, 2024

Hey everyone,

Sorry for the delay. We have been working on this, and have landed large changes to the SDK.

Here is a beta version of Crashlytics SDK 19.2.0 which resolves several of the issues that have been causing ANRs. This version is different from 19.1.0 which will be released in the next day or so. 19.1.0 only includes some of these changes, but has gone through more validation.

If you want to try the 19.2.0 beta, follow these steps:

Download the artifact m2repository.zip and extract it to a local repo directory.

Add something like the following to your app's gradle build files:

// settings.gradle.kts
dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    maven(uri("/path/to/local/repo/"))
    google()
    mavenCentral()
  }
}
// app/build.gradle.kts
dependencies {
  implementation("com.google.firebase:firebase-crashlytics:19.2.0-beta01")
  // ...
}

The CHANGELOG is:

* [feature] Added the `isCrashlyticsCollectionEnabled` API to check if Crashlytics collection is enabled.
* [fixed] Ensure that on-demand fatal events are never processed on the main thread.
* [fixed] Improved data consistency for rapid user actions.
* [changed] Internal changes to improve startup time.
* [changed] Internal changes to the way session IDs are generated.
* [changed] Internal changes to the way background tasks are scheduled.
* [changed] Migrated SDK to use standard Firebase executors.

If you don't want to try the beta, you can wait for the stable 19.1.0 release in the next few days, which includes some of these changes. The full 19.2.0 release is undergoing further internal validation.

@Krishnasony
Copy link

When firebase-crashlytics:19.2.0 is going to be release?. we are hoping this will get release on BoM version 33.4.0

@dhruvkaushal11
Copy link

When will 19.2.0 going to release? Since people are adopting to Android 14, seeing exponential increase in the counts.
image

@ChanakaWeerasinghe
Copy link

Any update ????

main (timed waiting):tid=1 systid=6935 
     at jdk.internal.misc.Unsafe.park(Native method)
     at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717)
     at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074)
     at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
     at bm5.f(Utils.java:4)
     at g72.d(IdManager.java:2)
     at g72.a(IdManager.java:8)
     at bv.<init>(CLSUUID.java:5)
     at we0.s(CrashlyticsCore.java:4)
     at com.google.firebase.crashlytics.a.e(FirebaseCrashlytics.java:34)
     at com.google.firebase.crashlytics.CrashlyticsRegistrar.b(CrashlyticsRegistrar.java:8)
     at com.google.firebase.crashlytics.CrashlyticsRegistrar.a(unavailable)
     at df0.create(unavailable:2)
     at h80.c(ComponentMonitor.java:2)
     at h80.b(unavailable)
     at g80.create(unavailable:4)
     at o80.q(ComponentRuntime.java:2)
     at o80.i(unavailable)
     at k80.get(unavailable:4)
     at wr2.get(Lazy.java:5)
     at o80.n(ComponentRuntime.java:5)
     at o80.o(ComponentRuntime.java:5)
     at cg1.t(FirebaseApp.java:7)
     at cg1.w(FirebaseApp.java:13)
     at cg1.v(FirebaseApp.java:1)
     at cg1.u(FirebaseApp.java:7)
     at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:2)
     at android.content.ContentProvider.attachInfo(ContentProvider.java:2443)
     at android.content.ContentProvider.attachInfo(ContentProvider.java:2413)
     at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:2)
     at android.app.ActivityThread.installProvider(ActivityThread.java:7721)
     at android.app.ActivityThread.installContentProviders(ActivityThread.java:7233)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6990)
     at android.app.ActivityThread.access$1600(ActivityThread.java:273)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2173)
     at android.os.Handler.dispatchMessage(Handler.java:106)
     at android.os.Looper.loopOnce(Looper.java:241)
     at android.os.Looper.loop(Looper.java:342)
     at android.app.ActivityThread.main(ActivityThread.java:8143)
     at java.lang.reflect.Method.invoke(Native method)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
      

@shrift
Copy link

shrift commented Sep 27, 2024

Is there an update about this? We rolled out and update with 19.1.0, but we're still seeing the same problems.
If 19.2.0 won't be released very very soon we'll have to strip firebase out of the app until the fix is released.

@Deepakkast
Copy link

Any update on the above getting multiple ANR due to this
affecting the app performance

@mrober
Copy link
Contributor

mrober commented Sep 30, 2024

Morning everybody,

Crashlytics 19.2.0 is scheduled to be released this week unless some delay happens. It will improve Crashlytics performance and mitigate the ANRs mentioned earlier in this issue. But it probably will not fix the Android 14 ANR because that is due to another Firebase dependency. That issue is also being worked on in #6147 and is a priority for them. If it can be completed and verified before the release it might be included. Otherwise, it will probably be an out of band release. I will update this issue after the release and let everybody know.

@mrober
Copy link
Contributor

mrober commented Sep 30, 2024

@ChanakaWeerasinghe I cannot tell for sure due to the obfuscation, but I am pretty sure your issue was fixed in 19.1.0. Can you please check if you are on the latest version?

@jadroid92
Copy link

Crashlytics 19.2.0 has finally been released.

https://firebase.google.com/support/release-notes/android#latest_sdk_versions

Crashlytics version 19.2.0:

  • Improved data consistency for rapid user actions.
  • Fixed exception propagation in the case of no default uncaught exception handler.
  • Internal changes to improve startup time.
  • Internal changes to the way background tasks are scheduled.
  • Migrated SDK to use standard Firebase executors.

@dhruvkaushal11
Copy link

dhruvkaushal11 commented Oct 3, 2024

@mrober So, 19.2.0 contains Android 14 ANR fix as well?

@hakanbagci
Copy link

hakanbagci commented Oct 3, 2024

Morning everybody,

Crashlytics 19.2.0 is scheduled to be released this week unless some delay happens. It will improve Crashlytics performance and mitigate the ANRs mentioned earlier in this issue. But it probably will not fix the Android 14 ANR because that is due to another Firebase dependency. That issue is also being worked on in #6147 and is a priority for them. If it can be completed and verified before the release it might be included. Otherwise, it will probably be an out of band release. I will update this issue after the release and let everybody know.

@mrober Does 19.2.0 release include Android 14 ANR fix? Could you please confirm?

@mrober
Copy link
Contributor

mrober commented Oct 3, 2024

Hey everybody, unfortunately 19.2.0 does not include a fix for the Android 14 issue. The Crashlytics ANRs have been addressed and I want to separate the two issues. So please check #6147 for the Android 14 issue, and I will close this issue for the Crashlytics ANRs. If you run into another another Crashlytics ANR, please submit a new issue. If you run into the Android 14 issue, please comment on #6147.

@mrober mrober closed this as completed Oct 3, 2024
@dhruvkaushal11
Copy link

Hey everybody, unfortunately 19.2.0 does not include a fix for the Android 14 issue. The Crashlytics ANRs have been addressed and I want to separate the two issues. So please check #6147 for the Android 14 issue, and I will close this issue for the Crashlytics ANRs. If you run into another another Crashlytics ANR, please submit a new issue. If you run into the Android 14 issue, please comment on #6147.

Thanks for the update @mrober

@firebase firebase locked and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: crashlytics priority: p2 triaged-accepted Triaged planned to fix in a future release
Projects
None yet
Development

No branches or pull requests