1

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

John smith
  • 67
  • 7

1 Answers1

1

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
blackapps
  • 8,011
  • 2
  • 11
  • 25
  • unfortunately I do not get what you mean what do you think about this? https://stackoverflow.com/a/52849797/12912064 – John smith Jan 12 '21 at 17:04
  • Well what do you mean with `myadress'? And where is the code that we can see where the file resides? – blackapps Jan 12 '21 at 17:08
  • You should use path /data/data/myadress/files/aFile.xlsx i said. – blackapps Jan 12 '21 at 17:09
  • myadress is the domain of my company. and filesDir from `createTemporaryFile(filesDir)` is an SDK method from ContextWrapper Class inbuilt in android, it stays for getFilesDir(). Do I guess anyway that the link I gave could resolve the issue, I see it solved it for everyone with the same problem – John smith Jan 12 '21 at 17:14
  • `myadress is the domain of my company. ` The name of your company is irrelevant for this problem. Your name too. It should be the package name of your app. And that's what i used. Tell us full path of your file as all is unknown. – blackapps Jan 12 '21 at 17:39
  • yes this the full path in the xml was 'Android/data/com.company/files/Pictures` but now I changed all with `"."` – John smith Jan 12 '21 at 17:52