file_manager icon indicating copy to clipboard operation
file_manager copied to clipboard

File Access Permission Not working on Android

Open mohamedaminehnioua opened this issue 2 years ago • 6 comments

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 avatar Apr 06 '23 15:04 mohamedaminehnioua

Does anyone have a solution to this problem?

ablause avatar Apr 18 '23 08:04 ablause

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();

steffomix avatar May 01 '23 10:05 steffomix

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 .

mohamedaminehnioua avatar May 02 '23 14:05 mohamedaminehnioua

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

Mustafa-Mohammad-kurdi avatar May 17 '23 08:05 Mustafa-Mohammad-kurdi

same issue i facing

joshua750 avatar Jul 27 '23 05:07 joshua750

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

laowangDemon avatar Aug 11 '23 06:08 laowangDemon