flutter_background_service
flutter_background_service copied to clipboard
Amount of ANR's increased since upgrading
Since upgrading from 3.0.1 I've been getting a steady stream of ANR crash reports on Crashlytics for Android. The ANR reports seem to happen at random with many different places getting the reports. Most, but not all, seem to happen during unregister:
main (native):tid=1 systid=18361
#00 pc 0x4c35c libc.so (syscall + 28) (BuildId: ba489d4985c0cf173209da67405662f9)
#01 pc 0x3a9ae4 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 140) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#02 pc 0x5680a4 libart.so (artQuickGenericJniEndTrampoline + 1200) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#03 pc 0x461564 libart.so (art_quick_generic_jni_trampoline + 164) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#04 pc 0x28c8f78 memfd:jit-zygote-cache (android.hardware.SystemSensorManager$BaseEventQueue.removeAllSensors + 312)
#05 pc 0x28cc220 memfd:jit-zygote-cache (android.hardware.SystemSensorManager.unregisterListenerImpl + 240)
#06 pc 0x28c7a5c memfd:jit-zygote-cache (android.hardware.SensorManager.unregisterListener + 76)
#07 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#08 pc 0x41b5f8 base.vdex (h9.b.onCancel + 16)
#09 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#10 pc 0x41b4ac base.vdex (h9.a.b + 204)
#11 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#12 pc 0x41b252 base.vdex (h9.a.onDetachedFromEngine + 10)
#13 pc 0x20b074 libart.so (nterp_helper + 7540) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#14 pc 0x43988e base.vdex (io.flutter.embedding.engine.c.g + 242)
#15 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#16 pc 0x4398ec base.vdex (io.flutter.embedding.engine.c.y + 32)
#17 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#18 pc 0x43991e base.vdex (io.flutter.embedding.engine.c.z + 22)
#19 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#20 pc 0x43920c base.vdex (io.flutter.embedding.engine.c.o + 20)
#21 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#22 pc 0x43a1ba base.vdex (io.flutter.embedding.engine.a.f + 62)
#23 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#24 pc 0x42c292 base.vdex (id.flutter.flutter_background_service.BackgroundService.onDestroy + 74)
#25 pc 0x25b42d4 memfd:jit-zygote-cache (android.app.ActivityThread.handleStopService + 548)
#26 pc 0x259594c memfd:jit-zygote-cache (android.app.ActivityThread$H.handleMessage + 5292)
#27 pc 0x2068f28 memfd:jit-zygote-cache (android.os.Handler.dispatchMessage + 184)
#28 pc 0x29ac9fc memfd:jit-zygote-cache (android.os.Looper.loopOnce + 1020)
#29 pc 0x20865d0 memfd:jit-zygote-cache (android.os.Looper.loop + 576)
#30 pc 0x25bb3d8 memfd:jit-zygote-cache (android.app.ActivityThread.main + 1432)
#31 pc 0x457e00 libart.so (art_quick_invoke_static_stub + 576) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#32 pc 0x48c038 libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long) + 1560) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#33 pc 0x48b9f8 libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277) + 48) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#34 pc 0x461554 libart.so (art_quick_generic_jni_trampoline + 148) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#35 pc 0x2d39308 memfd:jit-zygote-cache (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 136)
#36 pc 0x20b0d4 libart.so (nterp_helper + 7636) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#37 pc 0x24d4d4 framework.jar (com.android.internal.os.ZygoteInit.main + 612)
#38 pc 0x457e00 libart.so (art_quick_invoke_static_stub + 576) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#39 pc 0x58bc24 libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list) + 912) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#40 pc 0x609b6c libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list) + 172) (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
#41 pc 0xaeac4 libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...) + 120) (BuildId: f21e19bfa4e5c3afad804a71681c9fca)
#42 pc 0xba05c libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool) + 836) (BuildId: f21e19bfa4e5c3afad804a71681c9fca)
#43 pc 0x258c app_process64 (main + 1336) (BuildId: 4ecb2c57d6667e4a94a73568ce392d22)
#44 pc 0x488c8 libc.so (__libc_init + 96) (BuildId: ba489d4985c0cf173209da67405662f9)
at android.hardware.SystemSensorManager$BaseEventQueue.nativeDisableSensor(Native method)
at android.hardware.SystemSensorManager$BaseEventQueue.disableSensor(SystemSensorManager.java:809)
at android.hardware.SystemSensorManager$BaseEventQueue.removeAllSensors(SystemSensorManager.java:729)
at android.hardware.SystemSensorManager.unregisterListenerImpl(SystemSensorManager.java:234)
at android.hardware.SensorManager.unregisterListener(SensorManager.java:679)
at dev.fluttercommunity.plus.sensors.StreamHandlerImpl.onCancel(StreamHandlerImpl.java:8)
at dev.fluttercommunity.plus.sensors.SensorsPlugin.teardownEventChannels(SensorsPlugin.java:102)
at dev.fluttercommunity.plus.sensors.SensorsPlugin.onDetachedFromEngine(SensorsPlugin.java:5)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:121)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.remove(FlutterEngineConnectionRegistry.java:16)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.removeAll(FlutterEngineConnectionRegistry.java:11)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.destroy(FlutterEngineConnectionRegistry.java:10)
at io.flutter.embedding.engine.FlutterEngine.destroy(FlutterEngine.java:31)
at id.flutter.flutter_background_service.BackgroundService.onDestroy(unavailable:37)
at android.app.ActivityThread.handleStopService(ActivityThread.java:4673)
at android.app.ActivityThread.access$2100(ActivityThread.java:247)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2100)
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:7842)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Hello, @Wackymax, Have you code for IOS with this dependency?
Hi, @Wackymax ,My first time using 3.0.1, I also encountered many ANR issues. Based on your prompt, I plan to try downgrading to the previous version to see if there can be any improvement