iam using,
- flutter version:3.7.0
- Dart version 2.19.0
- android gradle version: 7.2.1
- target sdk version is 33, android sdk version : 33
- Java version Java(TM) SE Runtime Environment: 18.9
iam using flutter downloader version where below android 12 and below versions are working properly. when it comes to android 13 version is not working, but when i made prints it is showing status is complete even the file is not downloaded
Have added app/src/main/androidManifest.xml file:
<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" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
have also implemented device_info_plus plugin for identifying android sdk version and have requested the file permission for 13+ version:
Code:
Future<bool> _checkPermission() async {
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
if (androidInfo.version.sdkInt! >= 33) {
isVideosPermission = await Permission.videos.status.isGranted;
isPhotosPermission = await Permission.photos.status.isGranted;
} else {
isStoragePermission = await Permission.storage.status.isGranted;
}
if (isStoragePermission && isVideosPermission && isPhotosPermission) {
PermissionStatus permission = await Permission.storage.status;
if (permission != PermissionStatus.granted) {
PermissionStatus permissionStatus = await Permission.storage.request();
if (permissionStatus == PermissionStatus.granted) {
return true;
}
} else {
return true;
}
} else {
return true;
}
return false;
}
have successfully permission is added but unable to download the file, even the file downloading status is success (Complete).
what should i have to do?
Have upgraded the android sdk and target sdk version from 32 to 33. and added permissions in android manifest.xml and also imported the new library device_info_plus for detecting the android sdk version. and in the code at downloader.dart file have added few changes to android 13 version and above is different.
Try Using this method
UPDATED
Updating with the permissions i have added