Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter_inappwebview 5.3.2 package crashes the app when choosing a file or an image

I'm using flutter_inappwebview package because after some research I found that it's the only webview package that supports the features the I need, one of them is uploading a file to a certain website, I tried the example app flutter_inappwebview example and everything worked perfectly except when I try to select an image or a file from a website, it suddenly crashes and closes the app, so how can I fix this

like image 981
ahmad zabadnee Avatar asked Sep 15 '25 21:09

ahmad zabadnee


2 Answers

Problem solved by using this configuration

like image 196
ahmad zabadnee Avatar answered Sep 18 '25 18:09

ahmad zabadnee


STEP 1 Configure Android On Android, you need to add these permissions in your AndroidManifest.xml file to be able to use camera for taking images and videos:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />

STEP 2

Also, you need to add the following code inside the tag of your AndroidManifest file:

<provider
android:name="com.pichillilorenzo.flutter_inappwebview.InAppWebViewFileProvider"
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" />
like image 29
Huzaifa Ansari Avatar answered Sep 18 '25 18:09

Huzaifa Ansari