firebase-android-sdk
firebase-android-sdk copied to clipboard
Firelog sdk is using JobScheduler which is not recommended now
From @ankit92:
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
Originally posted by @ankit92 in https://github.com/firebase/firebase-android-sdk/issues/4345#issuecomment-2262159437