open_file icon indicating copy to clipboard operation
open_file copied to clipboard

Cant open any file from cache

Open Elendiar opened this issue 4 years ago • 4 comments

From path: /data/user/0/com.xxxx.xxxxx/cache/libCachedImageData/[any-file] dont opens. Images say that media not found, apk installer says wrong syntax. If i change to another folder, etc /sdcard/Download - it opens. But i need from cache... Android 6 emulator. result: done, ResultType.done

Or reason of it that another program (gallery or android installer) cant access this folder?

Elendiar avatar May 21 '21 10:05 Elendiar

I can approve this behavior also with new version.

hasanalpzengin avatar Jun 21 '21 07:06 hasanalpzengin

Same here. The following piece of code works great in Android Emulator, but not on Android Device:

final directory = await getTemporaryDirectory();
final path = directory.path;
final String urlFile = 'https://...';

await Dio()
	  .download(urlFile, path + '/some-file.pdf')
	  .whenComplete(() {
	OpenFile.open(path + '/some-file.pdf');
});

PINHOf avatar Jun 22 '21 18:06 PINHOf

Same here. The following piece of code works great in Android Emulator, but not on Android Device:

final directory = await getTemporaryDirectory();
final path = directory.path;
final String urlFile = 'https://...';

await Dio()
	  .download(urlFile, path + '/some-file.pdf')
	  .whenComplete(() {
	OpenFile.open(path + '/some-file.pdf');
});

I ran your code and it worked fine on Android11

crazecoder avatar Jul 02 '21 09:07 crazecoder

From path: /data/user/0/com.xxxx.xxxxx/cache/libCachedImageData/[any-file] dont opens. Images say that media not found, apk installer says wrong syntax. If i change to another folder, etc /sdcard/Download - it opens. But i need from cache... Android 6 emulator. result: done, ResultType.done

Or reason of it that another program (gallery or android installer) cant access this folder?

I don't think this is an available cache path, it should be like this

/Android/data/com.xxxx.xxx/cache

I have considered this problem for a moment. The intent opens a third-party app, but the third-party app does not have the permission to get the data/data/ directory of the current app. Maybe this is the reason

crazecoder avatar Jul 03 '21 07:07 crazecoder