flutter_downloader
flutter_downloader copied to clipboard
Android 13 Download not working,Working till android 12
This is manifest file
<queries>
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="${applicationId}.flutter_downloader.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
<!-- Begin FlutterDownloader customization -->
<!-- disable default Initializer -->
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>
<!-- declare customized Initializer -->
<provider
android:name="vn.hunghd.flutterdownloader.FlutterDownloaderInitializer"
android:authorities="${applicationId}.flutter-downloader-init"
android:exported="false">
<!-- changes this number to configure the maximum number of concurrent tasks -->
<meta-data
android:name="vn.hunghd.flutterdownloader.MAX_CONCURRENT_TASKS"
android:value="5" />
</provider>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
This is build gradle
def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } }
def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") }
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' }
def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' }
apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.hospital_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 29
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter { source '../..' }
dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:31.2.3')
// Add the dependencies for the In-App Messaging and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-inappmessaging-display'
implementation 'com.google.firebase:firebase-analytics-ktx'
}
Try background_downloader and see if it meets your needs.
I also have this problem, the download task has been in the queue
device : pixel 4a, android 13
Flutter version 3.7.10 on channel stable
i have the same problem
android 12
I thought same way for android and iOS both but after 2 days of hard-work I found out that my implementation was somewhat wrong. If you provide me with your implemented code, I'll do my best to assist you in resolving any issues you may be facing.
any progress? I try it on android 13 with pixel7a also not working... we always have the problem that hasStoragePermission is set to false
any progress? I try it on android 13 with pixel7a also not working... we always have the problem that hasStoragePermission is set to false
Set targetSdkVersion to 32
@Alvish0407 tried solution and download working now on android 13 but set target to 32 when you upload to play console need to upgrade to 33 is there a way that download working on targetSdkVersion 33 ?
@Alvish0407 tried solution and download working now on android 13 but set target to 32 when you upload to play console need to upgrade to 33 is there a way that download working on targetSdkVersion 33 ?
I have uploaded one app on play store having targetSdkVersion set to 32 though.
What error are using facing on console ? can you share ?
I think it will be problem in the neat future so I'm looking for a solution for download on api 33
I think it will be problem in the neat future so I'm looking for a solution for download on api 33
@781flyingdutchman has mentioned background_downloader above.
I haven't tried but maybe it might be what you are looking for. Let us know if you implement and make it work for 33.
Staring August 31 all Android apps uploaded to the Play store must target API 33. The background_downloader package supports API 33.
see this solution it's work with me https://github.com/fluttercommunity/flutter_downloader/issues/866#issuecomment-1637088268