Flutter_file_picker: App Exits after picking a file

Created on 15 Mar 2020  Â·  11Comments  Â·  Source: miguelpruivo/flutter_file_picker

i recently upgraded to v 1.5 , tried picking a file(multiple), then app exits without no error message or exception , i thought it was related to multiple files ,but its the same for single file, the previous version(1.4.3+2 ) works just fine ,

awaiting response bug wip

All 11 comments

Same problem!

same problem but with an deprecation error message

Same problem here.
Even when picking just one file.

Could you please check your adb logcat and then post the logs?

I need further details to help me check what might have cause it.

Also please your Android SDK version where this is happening as well as Flutter version.

Thank you!

Btw, @TesfahunK @Marcosmaliki @SeifKaroui did you update the FileType with camelCase after updating? You shouldn't be able to build anyway.

I also suggest you to do a full flutter clean before running again. There were structural changes due to Android V2 support.

I've been strongly trying to replicate this on emulator/device but it is working as intended, both on release and debug builds.

Ok, further update: I found the issue and I'm already working on it.

You should get some logs like this anyway:

E/AndroidRuntime(32542): java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
E/AndroidRuntime(32542):    at com.mr.flutter.plugin.filepicker.FilePickerDelegate.finishWithSuccess(FilePickerDelegate.java:186)
E/AndroidRuntime(32542):    at com.mr.flutter.plugin.filepicker.FilePickerDelegate.access$100(FilePickerDelegate.java:20)
E/AndroidRuntime(32542):    at com.mr.flutter.plugin.filepicker.FilePickerDelegate$2.run(FilePickerDelegate.java:98)

same problem !
and not working flutter clean or full restart ...

Ok, found the issue and it's actually directly related to the Flutter engine and not the plugin itself where it calls onActivityResult() twice when it shouldn't, as mentioned here and here.

This fix is landed on Flutter for versions above 1.14.6, like pointed here, so that means that if you are running on master, beta or dev, you won't have this issue whereas stable will do, for now.

Nevertheless, today I'm releasing 1.6.0 with web support and I'll add a temporary workaround for those on stable.

Added a temporary workaround for it and landed on pub.dev for 1.5.0+1.

Please, run a flutter clean and let me know if it worked for you.

Thank you all.

Added a temporary workaround for it and landed on pub.dev for 1.5.0+1.

Please, run a flutter clean and let me know if it worked for you.

Thank you all.

Thanks for your efforts.
It's working now 😃

Thank you. All working perfectly. We should buy you coffee ☕

Was this page helpful?
0 / 5 - 0 ratings