My new flutter version follows:
Flutter 3.13.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d211f42860 (7 days ago) • 2023-10-25 13:42:25 -0700
Engine • revision 0545f8705d
Tools • Dart 3.1.5 • DevTools 2.25.0
After upgrade I see following build error:
ERROR:D8: com.android.tools.r8.kotlin.H
ERROR:D8: com.android.tools.r8.kotlin.H
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform firebase-analytics-ktx-21.5.0.aar (com.google.firebase:firebase-analytics-ktx:21.5.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=19, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: C:\Users\Vitaliy\.gradle\caches\transforms-3\41525bdf5de3383fe28a17aaa9610b1b\transformed\jetified-firebase-analytics-ktx-21.5.0-runtime.jar.
> Error while dexing.
> Failed to transform play-services-measurement-api-21.5.0.aar (com.google.android.gms:play-services-measurement-api:21.5.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=19, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: C:\Users\Vitaliy\.gradle\caches\transforms-3\ce1b8deb6ac5da9f5a47c5868d41ba4c\transformed\jetified-play-services-measurement-api-21.5.0-runtime.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 https://help.gradle.org
BUILD FAILED in 2s
How to bypass this bug and still build the application?
Clearing caches, removing .gradle and similar folders change nothing.
For me, the issue comes from adding built_value: 8.7.0 in the dependencies (either directly or indirectly), while using firebase_analytics plugin. And it will only occur if your app level(android/app/) build.gradle compileSdkversion is 34. An issue was created on flutterfire repo so lets wait for the fix.
One temporary workaround would be either
built_valueI didn't need to change anything else so see what works for you.
I have the same issue, it seems this is some kind of bug. Downgrading to
classpath 'com.android.tools.build:gradle:7.3.0'
seems to resolve this. More info could be found here: https://github.com/firebase/flutterfire/issues/11853
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With