Skip to content
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 file in app bundle? #271

Closed
magic3584 opened this issue Nov 29, 2023 · 2 comments
Closed

Cannot open file in app bundle? #271

magic3584 opened this issue Nov 29, 2023 · 2 comments

Comments

@magic3584
Copy link

magic3584 commented Nov 29, 2023

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')

@PUPSYANDRIK7777
Copy link

@crazecoder
Copy link
Owner

fix in 3.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants