In my Android Unity plugin, I want to provide access to the screenshot that unity made, so provide access to Application.persistentDataPath
, which is the files
folder of the app per documentation...
<?xml version="1.0" encoding="utf-8"?>
<paths>
<files-path name="files" path="."/>
</paths>
I want also to read / write external storage. But as soon as I add...
<!-- For access `DICM/Camera` -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
...to the manifest, Unity adds the screenshots to the external storage, so FileProvider
cannot provide files from there.
java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/<PACKAGE_NAME>/files/<FILE_NAME>
How can I still provide files from app files
directory wherever it resides?