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

File Access Permission Not working on Android #25

Open
mohamedaminehnioua opened this issue Apr 6, 2023 · 6 comments
Open

File Access Permission Not working on Android #25

mohamedaminehnioua opened this issue Apr 6, 2023 · 6 comments

Comments

@mohamedaminehnioua
Copy link

Requesting file permission is not working on Android too.

AndroidManifest.xml

  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
   <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

log:
Unhandled Exception: MissingPluginException(No implementation found for method requestFilesAccessPermission on channel myapp/channel).

@mohamedaminehnioua mohamedaminehnioua changed the title File Access Permission File Access Permission Not working on Android Apr 6, 2023
@ablause
Copy link

ablause commented Apr 18, 2023

Does anyone have a solution to this problem?

@steffomix
Copy link

Use permission handler as workaround. You most likely will need it anyway.
https://pub.dev/packages/permission_handler

import 'package:permission_handler/permission_handler.dart';

await Permission.manageExternalStorage.isGranted;
await Permission.manageExternalStorage.request();

@mohamedaminehnioua
Copy link
Author

mohamedaminehnioua commented May 2, 2023

Use permission handler as workaround. You most likely will need it anyway. https://pub.dev/packages/permission_handler

import 'package:permission_handler/permission_handler.dart';

await Permission.manageExternalStorage.isGranted; await Permission.manageExternalStorage.request();

It's true, but they should make it work like that the package will be independent and not require any other packages .

@Mustafa-Mohammad-kurdi
Copy link

Mustafa-Mohammad-kurdi commented May 17, 2023

I/flutter (27441): FileSystemException: Directory listing failed, path = '/storage/emulated/0/' (OS Error: Permission denied, errno = 13)
E/flutter (27441): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method requestFilesAccessPermission on channel myapp/channel)
E/flutter (27441): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
E/flutter (27441):
E/flutter (27441): #1 FileManager.requestFilesAccessPermission (package:file_manager/file_manager.dart:116:9)
E/flutter (27441):
E/flutter (27441): #2 HomePage.build. (package:bredar/main.dart:95:12)
E/flutter (27441):
E/flutter (27441):

@joshua750
Copy link

same issue i facing

@laowangDemon
Copy link

laowangDemon commented Aug 11, 2023

set targetSdkVersion 29
if targetSdkVersion>=30
AndroidMainfest.xml add android:preserveLegacyExternalStorage="true"

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

6 participants