Execution failed for task ':transformDexWithDexForRelease'

:transformDexWithDexForRelease
FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:transformDexWithDexForRelease’.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/measurement/zzkt;

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
35 actionable tasks: 1 executed, 34 up-to-date
(node:14245) UnhandledPromiseRejectionWarning: Error: /home/manzer/ionic/carv2/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:transformDexWithDexForRelease’.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/measurement/zzkt;

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
at ChildProcess.whenDone (/home/manzer/ionic/carv2/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at ChildProcess.emit (events.js:180:13)
at maybeClose (internal/child_process.js:936:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:14245) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14245) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v9.11.1
    npm               : 5.6.0 
    OS                : Linux 4.13

Environment Variables:

    ANDROID_HOME : /home/manzer/Android/Sdk

Misc:

    backend : pro

1 Like

I am also facing this problem.

anyone have the solution of this…i am also facing this problem

have you found the solution of this problem

You can by-pass the error by adding this plugin to your project :

cordova plugin add --save https://github.com/jwall149/cordova-multidex
3 Likes

yes this worked !

Sam