actionViewIntent error "Failed to find configured root that contains.."
See original GitHub issueVersions: react-native-cli: 2.0.1 react-native: 0.55.1 rn-fetch-blob: 0.10.13,
Hey! I’m having some problems trying to use the RNFetchBlob.android.actionViewIntent
function. When I call it, it throws me this error:
Error: Failed to find configured root that contains /data/data/com.irpfvisaoapp/files/declaration-files/6becc170-b03a-11e8-a70e-876c3834b6e5_2013_DEC.pdf
at createErrorFromErrorData (NativeModules.js:121)
at NativeModules.js:78
at MessageQueue.__invokeCallback (MessageQueue.js:398)
at MessageQueue.js:137
at MessageQueue.__guardSafe (MessageQueue.js:314)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:136)
at debuggerWorker.js:
I’m invoking it like this: await RNFetchBlob.android.actionViewIntent(path, "application/pdf")
I’m checking if the file exists before running it using RNFetchBlob.fs.exists(path)
and it returns true
as the file really exists. I’ve also tried to put file://
in the beginning of the path, but it didn’t work either.
const exists = await RNFetchBlob.fs.exists(path)
console.log(path, exists) // "/data/user/0/com.irpfvisaoapp/files/declaration-files/6becc170-b03a-11e8-a70e-876c3834b6e5_2013_DEC.pdf" true
I’ve noticed that the “data” is duplicated in the path inside the error message, but if I try to remove it from the path, the error still occurs.
Any suggestions?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
IllegalArgumentException: Failed to find configured root - ...
I'm trying to take a picture with camera, but I'm getting the following error:
Read more >Android: FileProvider IllegalArgumentException Failed to find ...
Android : Android: FileProvider IllegalArgumentException Failed to find configured root that contains /data/data/**/files/Videos/final.mp4 ...
Read more >Android : FileProvider - Failed to find configured root - YouTube
Android : FileProvider - IllegalArgumentException: Failed to find configured root [ Beautify Your Computer ...
Read more >Android Question Failed to find configured root
The logged error is: "Caused by: java.lang.IllegalArgumentException: Failed to find configured root that contains ...
Read more >Intent | Android Developers
Create an intent to launch the main (root) activity of a task. ... Callers must include CATEGORY_OPENABLE in the Intent to obtain URIs...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, after some research I’ve found that it’s required to create a provider for it to work.
In the case of rn-fetch-blob, it looks for a provider named
provider_paths
instead offile_paths
.So, what I did was to create a xml file
android/app/src/main/res/xml/provider_paths.xml
with the following content:Hope this can help people that may have the same problem. C/C @antofa
I have this problem too.