Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

when upload file in android app crash #297

Closed
alyabbasi93 opened this issue Mar 2, 2020 · 9 comments
Closed

when upload file in android app crash #297

alyabbasi93 opened this issue Mar 2, 2020 · 9 comments

Comments

@alyabbasi93
Copy link

ava.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://com.android.externalstorage.documents/document/primary:logo.png flg=0x1 }} to activity {com.blogepoch/com.blogepoch.MainActivity}: java.lang.IllegalStateException: showFileChooser result was already called
at android.app.ActivityThread.deliverResults(ActivityThread.java:4360)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4402)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: showFileChooser result was already called
at xs.onReceiveValue(PG:4)
at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebViewChromeClient.onActivityResult(InAppWebViewChromeClient.java:598)
at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:634)
at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:367)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:546)
at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:594)
at android.app.Activity.dispatchActivityResult(Activity.java:7454)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4353)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4402) 
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6669) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
2020-03-02 13:15:58.154 21525-21525/com.blogepoch I/Process: Sending signal. PID: 21525 SIG: 9

@Yxjie
Copy link

Yxjie commented May 29, 2020

E/CrashReport(12896): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=0, data=null} to activity {net.sunjiji.app/net.sunjiji.app.MainActivity}: java.lang.IllegalStateException: showFileChooser result was already called
E/CrashReport(12896): at android.app.ActivityThread.deliverResults(ActivityThread.java:4655)
E/CrashReport(12896): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4697)
E/CrashReport(12896): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
E/CrashReport(12896): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:113)
E/CrashReport(12896): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:71)
E/CrashReport(12896): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2029)
E/CrashReport(12896): at android.os.Handler.dispatchMessage(Handler.java:106)
E/CrashReport(12896): at android.os.Looper.loop(Looper.java:224)
E/CrashReport(12896): at android.app.ActivityThread.main(ActivityThread.java:7074)
E/CrashReport(12896): at java.lang.reflect.Method.invoke(Native Method)
E/CrashReport(12896): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:536)
E/CrashReport(12896): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:928)
E/CrashReport(12896): Caused by: java.lang.IllegalStateException: showFileChooser result was already called
E/CrashReport(12896): at com.android.webview.chromium.WebViewContentsClientAdapter$4.onReceiveValue(WebViewContentsClientAdapter.java:4)
E/CrashReport(12896): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebViewChromeClient.onActivityResult(InAppWebViewChromeClient.java:597)
E/CrashReport(12896): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:691)
E/CrashReport(12896): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:378)
E/CrashReport(12896): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:597)
E/CrashReport(12896): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:582)
E/CrashReport(12896): at android.app.Activity.dispatchActivityResult(Activity.java:7592)
E/CrashReport(12896): at android.app.ActivityThread.deliverResults(ActivityThread.java:4648)

This was referenced Jul 6, 2020
@osamtimizer
Copy link

@alyabbasi93
I faced the same issue, but I resolved it with the following steps.

  1. update package to v4.0.0+4
  2. add provider tag on your AndroidManifest.xml
    https://github.com/pichillilorenzo/flutter_inappwebview#how-to-enable-the-usage-of-camera-for-html-inputs-such-as-input-typefile-acceptimage-capture

@MeherBa
Copy link

MeherBa commented Sep 29, 2020

@alyabbasi93
I faced the same issue, but I resolved it with the following steps.

  1. update package to v4.0.0+4
  2. add provider tag on your AndroidManifest.xml
    https://github.com/pichillilorenzo/flutter_inappwebview#how-to-enable-the-usage-of-camera-for-html-inputs-such-as-input-typefile-acceptimage-capture

Can you share your AndroidManifest.xml please? because i still have the same issue.

@ch-muhammad-adil
Copy link

@alyabbasi93
I faced the same issue, but I resolved it with the following steps.

  1. update package to v4.0.0+4
  2. add provider tag on your AndroidManifest.xml
    https://github.com/pichillilorenzo/flutter_inappwebview#how-to-enable-the-usage-of-camera-for-html-inputs-such-as-input-typefile-acceptimage-capture

Can you share your AndroidManifest.xml please? because i still have the same issue.

You can see sample file here
https://github.com/pichillilorenzo/flutter_inappwebview/blob/master/example/android/app/src/main/AndroidManifest.xml

@vikivyas
Copy link

<provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.flutter_inappwebview.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

        <provider
            android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
            android:authorities="${applicationId}.flutter_downloader.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths"/>
        </provider>

androidx.core.content.FileProvider and vn.hunghd.flutterdownloader.DownloadedFileProvider is giving error. What should I have therefore.

@mobin-sk
Copy link

After adding Providers to Manifest, Failed to launch app :
Error :
java.lang.RuntimeException: Unable to get provider vn.hunghd.flutterdownloader.DownloadedFileProvider: java.lang.ClassNotFoundException: Didn't find class "vn.hunghd.flutterdownloader.DownloadedFileProvider" on path: DexPathList[[zip file "/data/app/~~8IcbpeptpER228YgXECeSg==/com.lab2land.irax-Rsu9BtxWH8g753JVMUKZrg==/base.apk"],nativeLibraryDirectories==]

Using Version :
flutter_inappwebview: ^5.7.2+3

Did i need to add anything more ?

@mobin-sk
Copy link

I Have Added only one Provider then app builds without issues

Added Provider :

<provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.flutter_inappwebview.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

@FatihBaycu
Copy link

https://stackoverflow.com/a/71968030/16504129
This worked for me. I used the code as is, I did not make any changes.

Copy link

github-actions bot commented Oct 7, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants