Android: FileProvider IllegalArgumentException pas réussi à trouver la racine de configuration qui contient /data/data/**/fichiers/Vidéos/final.mp4

Je suis en train d'utiliser FileProvider pour lire une vidéo à partir de chemin d'accès privé.Face à

java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/XXXXX(Package)/files/Videos/final.mp4

Code:

<paths>
    <files-path path="my_docs" name="Videos/" />
</paths>

De code Java:

File imagePath = new File(getFilesDir(), "Videos");
File newFile = new File(imagePath, "final.mp4");
Log.d(TAG, "-------------newFile:"+newFile.exists());//True here
//Exception in below line
Uri contentUri = FileProvider.getUriForFile(this,"com.wow.fileprovider", newFile);

Manifest.xml

<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="com.wow.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">

<meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/file_paths" />

Des indices sur ce?

Merci
Nitz

  • J'ai été faire "l'Attribut est manquant Android préfixe d'espace de noms" dans @xml/file_paths tandis que la mise en œuvre de Fileprovider plus tard..de toute façon je fini par égarer le nom et le chemin d'accès et fini avec ce problème..