flutter_cache_manager
flutter_cache_manager copied to clipboard
Some devices cannot open a cached file
I have pre-cache all the relevant files on a device, and their thumbnails:
for (FileModel fileModel in FileModels) {
await DefaultCacheManager().getSingleFile(fileModel.getUrl(resize: ImageResize.small));
await DefaultCacheManager().getSingleFile(fileModel.getUrl());
}
When a user sees the files, he can see their thumbnails, and then when a user attempts to open a file, I’m using:
DefaultCacheManager().getSingleFile(fileModel.getUrl()).then((File file) {
if (file != null) OpenFile(file.path);
})
In some devices this works well. In other devices these files will not open in their respective apps., This also happens when in the last step the file is != null, and the .path attribute is given... For example, if I open an image in Google Foto on a device where it does not work, it tries to open it but then it forces a close, with the message "NOT FOUND". The same with a .pdf, when I try to open it on Google Drive PDF Viewer, it does the same as Google Foto and it says "Impossible to open the file xxxxxxxx-xxxx-xxxx-xxxxxxxx.pdf". Really would appreciate any assistance.
@renefloor Please... I hope you have not forgotten me! ...And this major problem... :)
I am having exact same issue😢
I you have a little bit more information that would be useful. "Some devices cannot open a file" is not something I can test or try to reproduce.
@renefloor ... Are you telling us that after 6 month have you only read the title? What more informations do you need other than this:
I have pre-cache all the relevant files on a device, and their thumbnails:
for (FileModel fileModel in FileModels) { await DefaultCacheManager().getSingleFile(fileModel.getUrl(resize: ImageResize.small)); await DefaultCacheManager().getSingleFile(fileModel.getUrl()); } When a user sees the files, he can see their thumbnails, and then when a user attempts to open a file, I’m using:
DefaultCacheManager().getSingleFile(fileModel.getUrl()).then((File file) { if (file != null) OpenFile(file.path); }) In some devices this works well. In other devices these files will not open in their respective apps., This also happens when in the last step the file is != null, and the .path attribute is given... For example, if I open an image in Google Foto on a device where it does not work, it tries to open it but then it forces a close, with the message "NOT FOUND". The same with a .pdf, when I try to open it on Google Drive PDF Viewer, it does the same as Google Foto and it says "Impossible to open the file xxxxxxxx-xxxx-xxxx-xxxxxxxx.pdf". Really would appreciate any assistance.
Of course I did read more than the title, and sorry to keep you waiting, but this is a project that I work on mostly in my own time and alone, so I might be more willing to help you if you are willing to help me.
The part you quote is exactly my problem:
In some devices this works well. In other devices these files will not open in their respective apps., This also happens when in the last step the file is != null, and the .path attribute is given...
So first of all, 'some devices', is this iOS or Android? Does it always go wrong on certain devices and never on others? Does it always go wrong with Google Foto?
For now I don't even know if it is a problem with this library or with the OpenFile method, because on newer Android devices you need to make sure the permissions are set well if you want to share a file with other apps.
Of course I did read more than the title, and sorry to keep you waiting, but this is a project that I work on mostly in my own time and alone, so I might be more willing to help you if you are willing to help me.
I'm sure that you're doing your best efforts to make this good Library even better, and I'm not expecting that you use your time to solve my problem... but, please, if you reply after months giving the blame to the issue that is not correctly filled (when you never asked for other informations and never scheduled anything about the issue), it feels rude
The part you quote is exactly my problem:
In some devices this works well. In other devices these files will not open in their respective apps., This also happens when in the last step the file is != null, and the .path attribute is given...
So first of all, 'some devices', is this iOS or Android? Does it always go wrong on certain devices and never on others? Does it always go wrong with Google Foto?
Yes, it is. It always fails on some Android devices and never on other Android devices (I don't have and I never tried with iOS)
For now I don't even know if it is a problem with this library or with the OpenFile method, because on newer Android devices you need to make sure the permissions are set well if you want to share a file with other apps.
Umh... OK. So could it be only a permission issue? Independently from the underlying library? I will try to force the permission through Android settings, but is there a way for checking the permission is set from your library?
Which other informations would be helpful to you for trying to reproduce the issue?
Sorry if I wasn't clear. That I didn't respond for half a year was not because of the lack of info, but because I didn't have the time. Now I have more time to fix issues, so that is why I ask for more info if there is still a problem. However, to fix this issue I do need more info. If you can help me with the info I'm willing to give this issue a try, if not I'm afraid I'll have to close it.
It always fails on some Android devices and never on other Android devices
Great! So now at least I know it is an Android device, but you are still not telling me which devices fail. My blind guess is that it is not a specific device, but a specific Android version, but as long as you are not telling me what devices fail I cannot know why.