i found that my provider do not work. and always get error like Failed to find configured root that contains /data/data/xxxx/files/testt.txt
and here is my config. like
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true"
android:requestLegacyExternalStorage="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/my_paths"
tools:replace="android:resource" />
</provider>
with th my_paths is
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="externalPath" path="."/>
<files-path name="filePath" path="."/>
<cache-path name="cachePath" path="."/>
</paths>
after long times debug. i found some clues
[ ] E/flutter ( 3660): at com.crazecoder.openfile.utils.FileUtil.getFileUri(FileUtil.java:230)
[ ] E/flutter ( 3660): at com.crazecoder.openfile.OpenFilePlugin.startActivity(OpenFilePlugin.java:140)
[ ] E/flutter ( 3660): at com.crazecoder.openfile.OpenFilePlugin.doOpen(OpenFilePlugin.java:119)
[ ] E/flutter ( 3660): at com.crazecoder.openfile.OpenFilePlugin.onMethodCall(OpenFilePlugin.java:75)
It is written like this
uri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileProvider.com.crazecoder.openfile", new File(filePath));
But the readme.md clearly shows
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="xxx.xxx.xxxxx">
<application>
...
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"
tools:replace="android:resource" />
</provider>
</application>
</manifest>
in homepage
I'm a little confused
i found that my provider do not work. and always get error like Failed to find configured root that contains /data/data/xxxx/files/testt.txt
and here is my config. like
with th
my_pathsisafter long times debug. i found some clues
It is written like this
uri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileProvider.com.crazecoder.openfile", new File(filePath));But the readme.md clearly shows
in homepage
I'm a little confused