I am trying to download file. So in android 11 i need manage external storage permission. These permission i have given and they are working fine with android 11. downloading is happening and files are being stored. But when i work with android 10 then there is an error
no permissions found in manifest for 22 which i searched over internet and found that this is the error for
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
void getPermission() async {
var status = await Permission.storage.request();
var status3 = await Permission.manageExternalStorage.request();
if (status.isGranted && status3.isGranted) {
// print('granted');
//var status2 = await Permission.accessMediaLocation.request();
//if (status2.isGranted) {
setState(() {
_allowWriteFile = true;
});
} else {
// print("denied");
}
}
2
Answers
I’m having same issue I solve by doing this.For android 10 you have to give permission in mainActivity,
try adding the following in the android manifest file, inside application tag.