DEV Community

Alexandre Freire
Alexandre Freire

Posted on

1 2

Build Failed with an Exception – Unable to merge dex

Problema:

FAILURE: Build failed with an exception.

  • What went wrong:

Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Solução:

1) Vá até o android/app/build.gradle

2) Adicione o seguinte comando dentro do defaultConfig:

multiDexEnabled true
Enter fullscreen mode Exit fullscreen mode

Ficará algo assim:

defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "me.alexandrefreire.vendas"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay