skip to Main Content

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:UsersVitaliy.gradlecachestransforms-341525bdf5de3383fe28a17aaa9610b1btransformedjetified-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:UsersVitaliy.gradlecachestransforms-3ce1b8deb6ac5da9f5a47c5868d41ba4ctransformedjetified-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.

2

Answers


  1. 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

    • Reduce the compileSdkversion to 33 if its set to 34
    • Use older version of built_value

    I didn’t need to change anything else so see what works for you.

    Login or Signup to reply.
  2. Add in pubspec.yaml:

    dependency_overrides:
      built_value: 8.6.3
    

    Good bye problem;)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search