open_file
open_file copied to clipboard
Cannot open file in app bundle?
I have followed #98 , and config
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
then use
final status = await Permission.manageExternalStorage.request();
var file = await getAssetByName("close.png");
var r = await OpenFile.open(file.path,type:"image/png");
but comes the error:
Failed to find configured root that contains /data/data/com.xxx.xxx/app_flutter/close.png.
The console log is
I/flutter ( 7072): filePath:/data/user/0/com.xxx.xxx/app_flutter/close.png
E/MethodChannel#open_file( 7072): Failed to handle method call
E/MethodChannel#open_file( 7072): java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/com.xxx.xxx/app_flutter/close.png
The path has changed. And at the same time the close.png path is "assets/close.png" and I have used it in Image Image.asset('assets/close.png')
https://deposit.pictures/p/e0eb7d120f0