Randomly, on some Android device, I get the stacktrace from the title:
java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.i.c(androidx.lifecycle.o)' on a null object reference
at com.amolg.flutterbarcodescanner.FlutterBarcodeScannerPlugin.c(FlutterBarcodeScannerPlugin.java:4)
at com.amolg.flutterbarcodescanner.FlutterBarcodeScannerPlugin.onDetachedFromActivity(FlutterBarcodeScannerPlugin.java:1)
at io.flutter.embedding.engine.d.c(FlutterEngineConnectionRegistry.java:5)
at io.flutter.embedding.android.f.t(FlutterActivityAndFragmentDelegate.java:8)
at io.flutter.embedding.android.k.onDetach(FlutterFragment.java:3)
at androidx.fragment.app.Fragment.performDetach(Fragment.java:3)
at androidx.fragment.app.y.i(FragmentStateManager.java:3)
at androidx.fragment.app.y.m(FragmentStateManager.java:46)
at androidx.fragment.app.g0$d.c(SpecialEffectsController.java:2)
at androidx.fragment.app.g0$e.b(SpecialEffectsController.java:4)
at androidx.fragment.app.g0.j(SpecialEffectsController.java:21)
at androidx.fragment.app.r.P(FragmentManager.java:6)
at androidx.fragment.app.r.A(FragmentManager.java:5)
at androidx.fragment.app.m.h(FragmentController.java:1)
at androidx.fragment.app.i.onDestroy(FragmentActivity.java:2)
at androidx.appcompat.app.d.onDestroy(AppCompatActivity.java:1)
at android.app.Activity.performDestroy(Activity.java:7255)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1161)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4657)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4697)
at android.app.ActivityThread.-wrap7(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1720)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
java.lang.RuntimeException: Unable to destroy activity {xxx/xxx.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.i.c(androidx.lifecycle.o)' on a null object reference
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4670)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4697)
at android.app.ActivityThread.-wrap7(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1720)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Randomly, on some Android device, I get the stacktrace from the title:
OS: Android
Some models where it happened:
SM-T550 - Android 7.1.1 Redmi Note 8 Pro - Android 11 Nexus 5X - Android 6.0.1 ASUS_X008D - Android 7.0