cunarist / rinf

Rust for native business logic, Flutter for flexible and beautiful GUI
MIT License
1.82k stars 64 forks source link

I am running Android and this simple test code: #351

Closed thejobsmarket closed 2 months ago

thejobsmarket commented 2 months ago

Still cannot access the file system from Rust I probably need to do something to allow disk access for the rust process but I don't know what, so moving this back to being issues I am running Android and this simple test code:

    let paths = fs::read_dir("./").unwrap();
    for path in paths {
        debug_print!("Name: {}", path.unwrap().path().display());
    }

I/flutter (32666): A panic occurred in Rust. I/flutter (32666): panicked at native/hub/src/plugin_loader.rs:12:40: I/flutter (32666): called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

Originally posted by @thejobsmarket in https://github.com/cunarist/rinf/discussions/348#discussioncomment-9662532

temeddix commented 2 months ago

Hi, could you try this solution?

Please tell me if you're still facing the same problem.

thejobsmarket commented 2 months ago

I gave storage, external storage and all type of other access permissions; android:requestLegacyExternalStorage="true" but rinf keeps on crashing. Worst thing is that it crashes and afterwards does not respond any more: directory: / I/flutter (30201): trying: . I/flutter (30201): A panic occurred in Rust. I/flutter (30201): panicked at native/hub/src/plugin_loader.rs:26:36: I/flutter (30201): called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } I/flutter (30201): 0: I/flutter (30201): 1: I/flutter (30201): 2: I/flutter (30201): 3: I/flutter (30201): 4: When asked the directory, it is in /, I tried ., all the assets directories in pubspec.yaml,... Would it be helpful to prepare a special flutter project so the bug can be reproduced?

temeddix commented 2 months ago

I will close this issue because it's not a bug from Rinf. This phenomenon is related to Android app's permissions. See you at the discussions page #348 :)