-
Notifications
You must be signed in to change notification settings - Fork 664
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
Cannot open document with URI: com.android.providers.downloads.documents . #7
Comments
@sonathati thank you for your feedback, may I ask what is the source of the file? Miguel |
same issue for pdf file in Download |
@NukanTran what’s the path from the file you’re trying to load? Can you post your logs? |
I/FilePicker( 6736): Checking permission: android.permission.WRITE_EXTERNAL_STORAGE this is my logs |
@NukanTran Thank you. What’s the android version? |
Android 8.0 in Genymoution |
@NukanTran I might take a look into it later on. However, you are free to use the version on the |
@NukanTran @sonathati @zean00 apparently there are some files started with "raw" string that may lead to this issue on Android 8.0. Doesn't seem to happen with other versions though. I couldn't replicate the issue, however I'm PR a fix to the beta branch and maybe later today merge a version 1.0 on the master along with dart pub update. Let me know if it worked for you. edit: version 1.0 it's now live with the fixes on dart pub, thank you for your feedback. |
@miguelpruivo I just tried 1.0.2 from pub and build fails
Flutter version: |
@sonathati glad that you’ve spotted it. I know what it is, that’s something that shouldn’t had been committed, probably due to a later git squash, my bad. I’ll fix it later today. |
@sonathati everything should be working fine by now on |
@miguelpruivo I am not able to get the file name when picked from open from view. But Iam able to retrieve the file name when attached from file manager available in the drawer
|
@sonathati I believe that is already fixed in the |
@miguelpruivo I have tried in latest
|
Hi again @sonathati , this seems to be a very specific/tricky issue that might be related to the path of downloads folder or a disabled download manager. Anyway, I've committed an update that tries to solve or, at least, try to understand the issue. Could you clean & build with the Thank you. |
@miguelpruivo I could see issue still exists with the latest update, Working case:
Not working case:
|
Can I ask you where actually you’re trying to load the second path? I remember having an issue where some androids would display email attachments on the recent files but the files weren’t actually there, it was like a placeholder. Also @sonathati, can you clean and try with |
@miguelpruivo I have noticed that this bug started from image_picker provide by flutter team. You are right about the disabled downloads manager. But one thing I noticed in your version was that file picker works great when the file type is set to any. But as soon as file type is set IMAGE, it fails and gives the fatal exception. I think when we fail to retrieve the file path, we must copy the file to the cache directory and then get the path from there. It seems you are already implementing this for documents but since you are using image_picker as the source for picking files, it fails. |
Thank you for the insights @pushangupta can you confirm if you are using |
@miguelpruivo FileType.IMAGE |
@miguelpruivo Brother I did a little experiment. I changed the FileType to CUSTOM and gave file extension as JPG and guess what.. It fetched the exact same file it was failing on. Just a quick suggestion. If multiple file types(like JPG, PNG, SVG or JPEG) could be supported at the same time it would be better |
@pushangupta that’s why it has the |
@miguelpruivo I mean, FileType.IMAGE surely uses image_picker... right? I am trying to avoid image_picker. Moreover if, for example, I wanted to select docs of extensions pdf, docx or ppt only what can I do? |
@pushangupta right now you’d have to use |
Sure, I'll try and let you know |
It works great. I've tested for images, videos and pdf's. |
@tiholic does it fix this specific issue? |
Yes, now we can pick all types of files from downloads |
Issue closed, you can update the version. |
Cannot open document with URI: com.android.providers.downloads.documents.
App crashes when attaching document of above URI with below error :
The text was updated successfully, but these errors were encountered: