flutter_barcode_scanner
flutter_barcode_scanner copied to clipboard
Null Pointer Exception - Unable to resume activity
Describe the bug We have an app with 25,000 current users. The barcode scanner is working great for a majority of the users! A small group of our Android users are seeing crashes. :-(
The crashes are related to a variety of null pointer exceptions. The most prevalent exception is shown in the stack traces included at the bottom of this issue.
To Reproduce I am not sure how to reproduce -- they data is coming to us through Crashlytics.
Expected behavior The plugin should not have null pointer exceptions.
Screenshots None available.
Smartphone (please complete the following information):
- 44% Android 10
- 67% Samsung
Stack Traces Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.firstlinemedical.optum_flm_app/com.firstlinemedical.optum_flm_app.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=0, data=null} to activity {com.firstlinemedical.optum_flm_app/com.firstlinemedical.optum_flm_app.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void f.a.d.a.j$d.a(java.lang.Object)' on a null object reference at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4451) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4483) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2175) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:7860) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Caused by java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=0, data=null} to activity {com.firstlinemedical.optum_flm_app/com.firstlinemedical.optum_flm_app.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void f.a.d.a.j$d.a(java.lang.Object)' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:5143) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4438) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4483) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2175) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:7860) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void f.a.d.a.j$d.a(java.lang.Object)' on a null object reference at com.amolg.flutterbarcodescanner.FlutterBarcodeScannerPlugin.a(FlutterBarcodeScannerPlugin.java:28) at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.a(FlutterEnginePluginRegistry.java:25) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.a(FlutterEnginePluginRegistry.java:15) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.a(FlutterActivityAndFragmentDelegate.java:51) at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:2) at android.app.Activity.dispatchActivityResult(Activity.java:8292) at android.app.ActivityThread.deliverResults(ActivityThread.java:5136) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4438) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4483) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2175) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:7860) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Sorry for the delayed response.
The potential fix has been made in V 2.0.0, please refer to this now. Also please acknowledge that this resolves the issue for you.
I see the same exception with Version 2.0.0 on Android.
Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.my.app/com.my.app.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=0, data=null} to activity {com.my.app/com.my.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void g.a.d.a.j$d.b(java.lang.Object)' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3107)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3138)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=0, data=null} to activity {com.my.app/com.my.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void g.a.d.a.j$d.b(java.lang.Object)' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:3703)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3093)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3138)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void g.a.d.a.j$d.b(java.lang.Object)' on a null object reference
at com.amolg.flutterbarcodescanner.FlutterBarcodeScannerPlugin.onActivityResult(FlutterBarcodeScannerPlugin.java)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java)
at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java)
at android.app.Activity.dispatchActivityResult(Activity.java:6456)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3699)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3093)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3138)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
anything on this one? I am also getting it. Do you have any workarounds? @jayhaase
@AmolGangadhare any fix for this one?