Flutter_file_picker: App crashes if both image_picker and file_picker 1.3.0 are installed

Created on 13 Mar 2019  路  4Comments  路  Source: miguelpruivo/flutter_file_picker

The file_picker appears to be working fine, but any attempt to use the image_picker causes the app to crash, which will happen after a file is selected or captured by the camera, or when the user cancels selection or capture.

D/AndroidRuntime(12668): Shutting down VM
E/AndroidRuntime(12668): FATAL EXCEPTION: main
E/AndroidRuntime(12668): Process: app, PID: 12668
E/AndroidRuntime(12668): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2343, result=-1, data=Intent { }} to activity {MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(12668): at android.app.ActivityThread.deliverResults(ActivityThread.java:4126)
E/AndroidRuntime(12668): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4169)
E/AndroidRuntime(12668): at android.app.ActivityThread.-wrap20(ActivityThread.java)
E/AndroidRuntime(12668): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1552)
E/AndroidRuntime(12668): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(12668): at android.os.Looper.loop(Looper.java:154)
E/AndroidRuntime(12668): at android.app.ActivityThread.main(ActivityThread.java:6186)
E/AndroidRuntime(12668): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(12668): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
E/AndroidRuntime(12668): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
E/AndroidRuntime(12668): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(12668): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:124)
E/AndroidRuntime(12668): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:209)
E/AndroidRuntime(12668): at com.mr.flutter.plugin.filepicker.FilePickerPlugin$1.onActivityResult(FilePickerPlugin.java:85)
E/AndroidRuntime(12668): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:218)
E/AndroidRuntime(12668): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:143)
E/AndroidRuntime(12668): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:142)
E/AndroidRuntime(12668): at android.app.Activity.dispatchActivityResult(Activity.java:6937)
E/AndroidRuntime(12668): at android.app.ActivityThread.deliverResults(ActivityThread.java:4122)

Most helpful comment

Somehow, I'm glad that you've experienced this issue so quickly as it could lead some other users to come across this exception. A result callback was trying to be invoked when it shouldn't.

It was a minor fix, yet important. If you are using ^1.3.0 clean & update packages so it fetches the 1.3.1 that is now on dart pub. You should be fine now, nevertheless, let me know if it fixed for you.

Thank you.

All 4 comments

Hi. This is quite weird since they aren鈥檛 related in any way at the moment.

Can you described the steps to fully reproduce this? Does it happen on both platforms?

Thank you.

Hi, here are the steps to reproduce:

1) Add both image_picker and file_picker to your dependencies.
2) Make a call to ImagePicker.pickImage()

The app will stop the moment a file is selected or cancelled.

I currently running on Android only, so I'm not sure if this happens on iOS.

Somehow, I'm glad that you've experienced this issue so quickly as it could lead some other users to come across this exception. A result callback was trying to be invoked when it shouldn't.

It was a minor fix, yet important. If you are using ^1.3.0 clean & update packages so it fetches the 1.3.1 that is now on dart pub. You should be fine now, nevertheless, let me know if it fixed for you.

Thank you.

It's working perfectly now. Thank you for your prompt response and pushing out a fix so quickly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bkoznov picture bkoznov  路  5Comments

travisjayday picture travisjayday  路  7Comments

creativecreatorormaybenot picture creativecreatorormaybenot  路  6Comments

JAICHANGPARK picture JAICHANGPARK  路  3Comments

miguelpruivo picture miguelpruivo  路  7Comments