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

App crashes when clicked on deny camera permission on android 10 device #118

Open
akshaybenk opened this issue Feb 24, 2020 · 4 comments
Open

Comments

@akshaybenk
Copy link

akshaybenk commented Feb 24, 2020

java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=1, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {MainActivity}: java.lang.NullPointerException: Attempt to read from field 'io.flutter.plugin.common.MethodChannel$Result com.github.rmtmckenzie.qrmobilevision.QrMobileVisionPlugin$ReadingInstance.startResult' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:4846) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4887) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7403) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) Caused by: java.lang.NullPointerException: Attempt to read from field 'io.flutter.plugin.common.MethodChannel$Result com.github.rmtmckenzie.qrmobilevision.QrMobileVisionPlugin$ReadingInstance.startResult' on a null object reference at com.github.rmtmckenzie.qrmobilevision.QrMobileVisionPlugin.startingFailed(QrMobileVisionPlugin.java:183) at com.github.rmtmckenzie.qrmobilevision.QrMobileVisionPlugin.onRequestPermissionsResult(QrMobileVisionPlugin.java:64) at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:612) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:356) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onRequestPermissionsResult(FlutterActivityAndFragmentDelegate.java:509) at io.flutter.embedding.android.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:611) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8264) at android.app.Activity.dispatchActivityResult(Activity.java:8114) at android.app.ActivityThread.deliverResults(ActivityThread.java:4839) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4887)  at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:214)  at android.app.ActivityThread.main(ActivityThread.java:7403)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) 

The above log is printed when the app crashes.
The device used is miA2

[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.15.3 19D76, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)

Please look into this ASAP

@nmhernandez10
Copy link

I have the same issue :(

@booooza
Copy link
Contributor

booooza commented Apr 2, 2020

Same here on Android 9 and iOS 12. It can be prevented if QrCamera is wrapped with a permission check (e.g. with permission_handler) and the permission is requested before QrCamera gets rendered. Nevertheless is should probably be handled by the library.

@rmtmckenzie
Copy link
Owner

Closing as a duplicate of #59, but I think the issue still probably exists. I'll look into it when I get a minute, should be fairly soon now.

@booooza
Copy link
Contributor

booooza commented Apr 12, 2020

@rmtmckenzie yes, issue still exists with Version 1.0.0 (Android 9 and iOS 12)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants