John smith
John smith

Reputation: 77

Android path in the Fileprovider is not recognised

I get this following exception for xlsx, msg and xml

Caused by java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/myadress/aFile.xlsx
       at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:744)

I saw several issues related but cannot find where is the error

I am reading the official documentation but do not get where can be the bug because do not understand where is going wrong

Upvotes: 1

Views: 122

Answers (1)

blackapps
blackapps

Reputation: 9292

Failed to find configured root that contains /data/data/myadress/aFile.xlsx

You should serve from the files directory:

/data/data/<packagename>/files/aFile.xlsx

Upvotes: 1

Related Questions