Flutter Firebase Error (Execution failed for task ':app:mergeExtDexDebug')

4,648

After looking at your logs and online search here some potential fixes

1 use classpath com.google.gms:google-services:4.3.3

instead of

classpath 'com.google.gms:google-services:3.2.1 from github issue 1494

2 update your pubspec.yaml, migrate the project to AndroidX,enable multidex

Share:
4,648
Ollie
Author by

Ollie

Updated on December 16, 2022

Comments

  • Ollie
    Ollie over 1 year

    I'm new to programming, and I'm very new to flutter and firebase. I'm experimenting with this code (https://github.com/tattwei46/flutter_login_demo), but I've run into an error. Everything should be the same except I changed the google-service.json and GoogleService.plist to match up with my firebase apps, and I edited home-page.dart. Here is what was printed out:

    AGPBI: {"kind":"error","text":"Type com.google.android.gms.common.internal.zzf is referenced as an interface from com.google.android.gms.internal.zzcfb.","sources":[{}],"tool":"D8"}

    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 artifact 'firebase-analytics-impl.aar (com.google.firebase:firebase-analytics-impl:11.4.2)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=16}. Execution failed for DexingWithClasspathTransform: /Users/student/.gradle/caches/transforms-2/files-2.1/cfad2a10e4239993e5e793d023977752/jetified-firebase-analytics-impl-11.4.2/jars/classes.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 57s Finished with error: Gradle task assembleDebug failed with exit code 1

    Any solutions and/or ideas for what to look for? Flutter doctor reports no issues.