sidlatau / flutter_document_picker

Allows user pick a document. Picked document is copied to app temporary directory. Optionally allows pick document with specific extension only.
Apache License 2.0
41 stars 29 forks source link

Reply already submitted FATAL EXCEPTION #6

Closed acheronian closed 6 years ago

acheronian commented 6 years ago

Getting exception after following process:

Import file via flutter_document_picker -> copy file to local storage -> open file via open_file package... Implemented your package as described in your demo... Any ideas?

Many thanks in advance!

D/AndroidRuntime(14260): Shutting down VM E/AndroidRuntime(14260): FATAL EXCEPTION: main E/AndroidRuntime(14260): Process: at.pockethouse.app.appfrontenduserpockethouse, PID: 14260 E/AndroidRuntime(14260): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=3241360, result=-1, data=null} to activity {at.pockethouse.app.appfrontenduserpockethouse/at.pockethouse.app.appfrontenduserpockethouse.MainActivity}: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(14260): at android.app.ActivityThread.deliverResults(ActivityThread.java:3680) E/AndroidRuntime(14260): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3723) E/AndroidRuntime(14260): at android.app.ActivityThread.access$1300(ActivityThread.java:156) E/AndroidRuntime(14260): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1400) E/AndroidRuntime(14260): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(14260): at android.os.Looper.loop(Looper.java:211) E/AndroidRuntime(14260): at android.app.ActivityThread.main(ActivityThread.java:5389) E/AndroidRuntime(14260): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(14260): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(14260): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020) E/AndroidRuntime(14260): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815) E/AndroidRuntime(14260): Caused by: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(14260): at io.flutter.view.FlutterNativeView$1.reply(FlutterNativeView.java:174) E/AndroidRuntime(14260): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:194) E/AndroidRuntime(14260): at com.sidlatau.flutterdocumentpicker.FlutterDocumentPickerDelegate.onActivityResult(FlutterDocumentPickerDelegate.kt:62) E/AndroidRuntime(14260): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:210) E/AndroidRuntime(14260): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:139) E/AndroidRuntime(14260): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:138) E/AndroidRuntime(14260): at android.app.Activity.dispatchActivityResult(Activity.java:6192) E/AndroidRuntime(14260): at android.app.ActivityThread.deliverResults(ActivityThread.java:3676) E/AndroidRuntime(14260): ... 10 more I/Process (14260): Sending signal. PID: 14260 SIG: 9 Lost connection to device.

acheronian commented 6 years ago

Tried fiddling around in the FlutterDocumentPickerDelegate.kt file as I was getting the error at line 62, removed the "channelResult?.success(null)" part and it worked without crashing the VM.

Maybe the result is replied a second time and this interferes with future intents...

sidlatau commented 6 years ago

Thanks for catching a bug! I have released v1.1.1 package version with the fix.

acheronian commented 6 years ago

No problem 👍 Glad I could help.

dkofficial24 commented 2 years ago

I am using flutter_document_picker: ^5.0.1-nullsafety.0 version

Fatal Exception: java.lang.IllegalStateException Reply already submitted io.flutter.embedding.engine.dart.DartMessenger$Reply.reply (DartMessenger.java:35) io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success (MethodChannel.java:14) com.sidlatau.flutterdocumentpicker.FlutterDocumentPickerDelegate.onLoadFinished (FlutterDocumentPickerDelegate.java:20) com.sidlatau.flutterdocumentpicker.FlutterDocumentPickerDelegate.onLoadFinished (FlutterDocumentPickerDelegate.java:2) android.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished (LoaderManagerImpl.java:497) android.app.LoaderManagerImpl$LoaderInfo.onLoadComplete (LoaderManagerImpl.java:465) android.content.Loader.deliverResult (Loader.java:157) android.content.AsyncTaskLoader.dispatchOnLoadComplete (AsyncTaskLoader.java:272) android.content.AsyncTaskLoader$LoadTask.onPostExecute (AsyncTaskLoader.java:96) android.os.AsyncTask.finish (AsyncTask.java:695) android.os.AsyncTask.access$600 (AsyncTask.java:180) android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:712) android.os.Handler.dispatchMessage (Handler.java:106) android.os.Looper.loop (Looper.java:224) android.app.ActivityThread.main (ActivityThread.java:7134) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:876)