edufolly / flutter_mobile_vision

Flutter implementation of Google Mobile Vision.
MIT License
455 stars 168 forks source link

Deny Camera Permission crashed the app #17

Closed sleith closed 5 years ago

sleith commented 6 years ago

Hi, I found out that if I deny permission for camera, it will crash. Please find the log below Thank you

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9010, result=13, data=null} to activity {.MainActivity}: java.lang.IllegalStateException: Reply already submitted
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4196)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4239)
        at android.app.ActivityThread.-wrap20(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1599)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:165)
        at android.app.ActivityThread.main(ActivityThread.java:6365)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:883)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
     Caused by: java.lang.IllegalStateException: Reply already submitted
        at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:174)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:199)
        at io.github.edufolly.fluttermobilevision.FlutterMobileVisionPlugin.onActivityResult(FlutterMobileVisionPlugin.java:188)
        at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:210)
        at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:139)
        at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:138)
        at android.app.Activity.dispatchActivityResult(Activity.java:7116)
edufolly commented 5 years ago

Hi @sleith,

released a new version, please test. Waiting for your feedback.

wheel1992 commented 5 years ago

Hi, has this fix release to 0.1.4?

edufolly commented 5 years ago

Hi @wheel1992,

probably yes.