-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to find configured root that contains ... #255
Comments
Make sure this file is app private directory, then determine whether public directory, if not, you need to use |
I already did this before opening the file with this path now: /data/user/0/com.example.app/1.jpg |
I'm also having this issue. The requested directory looks like this:
I am using But when using
Is this correct or are we missing something here? Here is the
Here is the stacktrace:
OpenFile: 3.3.2 |
I tried it in the example, and it didn't report an error, it just couldn't find the file |
but the file is definitely there, I checked it via device explorer |
I've put together a simple test app to recreate this issue. Tested on Android 7 and 8.1 |
same issue. |
I don't know why, but when I add the code as below, it works fine. Hope you can help me in any way.
|
@JosephNK This works... Edit: looks like using "READ_EXTERNAL_STORAGE" is all that is necessary for this tag. I'm more interested in using "files-path", which should represent the internal storage area specific to your app. |
sometimes they do due to security reasons. But this is still not the real solution for this issue. EDIT: this fix does not work for me |
I completely agree. |
The same: but file was: |
This is definitely an issue when using internal directories like this:
When using "OpenFile", the former produces the directory of: This issue stems from this line There must be some association between the "FileProvider" and the resources/paths within "filepaths.xml" that is not working. |
Configuring <?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="files-path"
path="../" />
</paths> The important bit is I think what is happening is that "files-path" assumes a directory of However, this still seems to require "READ_EXTERNAL_STORAGE". Is this correct? |
Exactly, but this requirement is acutally not really needed because it's an app internal storage while runtime |
Just replace your fileprovider.xml or any name you have set for file-provider.xml code with below code
|
This is a question and not a solution. It seems like this is the solution to the problem. However what I don't understand it, where to find the fileprovider.xml in my project. Any help would be appreciated.
|
@praveenverma720 If you look at the previous two comments directly above yours, you will see that this has already been suggested. @mzeqirii The location for this file is: |
same issus ResultType.fileNotFound |
Same issue |
cool.can work |
I use this configured in working. <?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="files-path"
path="../" />
</paths> And , Save file use OpenFile.open('/data/user/0/com.xxxx.android/cache/image.png'); I can also help you. |
Replacing the filepath.xml with this finally worked for me.
|
used version: 3.3.2
flutter version: 3.10.4
anodrid 12
I cannot open my image with open_file. The app has permission (permission_handler) and I added everything to Manifest.xml.
The interesting thing is that I define a different path to the file than specified in the exception. I'm using '/data/user/0/xxx/images/1.jpg'
Seems to be the same issue as #94
I used this filepaths.xml:
<?xml version="1.0" encoding="utf-8"?> <resources> <external-path name="external_storage_directory" path="." /> </resources>
The text was updated successfully, but these errors were encountered: