So, I am making a flutter project and I am using,
flutter_background_service: ^5.0.7
and according to it’s pub dev page
Android
- To change notification icon, just add drawable icon with name
ic_bg_service_small
.
WARNING:
Please make sure your project already use the version of gradle tools below:
- in android/build.gradle
classpath 'com.android.tools.build:gradle:7.4.2'
- in android/build.gradle
ext.kotlin_version = '1.8.10'
- in android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-7.5-all.zip
Now, I need to change the notification icon, so i started doing all the necessary gradle changes.
rest of the changes work fine, but,
when i change the gradle version from classpath 'com.android.tools.build:gradle:7.3.0'
to classpath 'com.android.tools.build:gradle:7.4.2'
it starts to throw the following error :
FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':app:mergeExtDexDebug'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform play-services-location-21.2.0.aar (com.google.android.gms:play-services-location:21.2.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Execution failed for DexingWithClasspathTransform: C:UsersVE00YM616.gradlecachestransforms-35438959e30f2b11d4e9c97f9b5b93995transformedjetified-play-services-location-21.2.0-runtime.jar.
Error while dexing.
Failed to transform kotlin-stdlib-1.9.0.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
Execution failed for DexingWithClasspathTransform: C:UsersVE00YM616.gradlecachestransforms-3c720a0c0be6c35c14af88b71e38aaa3ftransformedjetified-kotlin-stdlib-1.9.0.jar.
Error while dexing.
* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
* Get more help at
BUILD FAILED in 2m 14shttps://help.gradle.org
my complete build.gradle file is given below:
https://pastebin.com/NqgxWJ6i
i have tried updating kotlin-version to 1.9.0, cleaned the project and gradle files. none of it is much helpful
how can i either solve this error, or change the notification icon from flutter-background-service in any other way. it would be greatly appreciated
if you need anymore data, please ping me