0

In my application I want use compile 'com.google.android.gms:play-services-gcm:10.2.1'
but when running application show me this error in Logcat :

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

I added multiDexSupport with this code but not work me and again show me this error!

Codes for multiDex:

//Build.gradle
defaultConfig {
    applicationId "com.tellfa.colony"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 12
    versionName "22"
    vectorDrawables.useSupportLibrary = true
    multiDexEnabled true
}

// MultiDex
compile 'com.android.support:multidex:1.0.2'

//Application class
@Override
protected void attachBaseContext(Context context) {
    super.attachBaseContext(context);
    MultiDex.install(this);
}

How can I fix it? please help me

  • Look in the Gradle Console output for more details, usually in the form of a stack trace. – CommonsWare Jan 07 '18 at 17:54
  • @CommonsWare, I am amateur. can you help me more? please –  Jan 07 '18 at 17:57
  • You will find the Gradle Console docked at the bottom of the Android Studio window. Open it. Read the contents. Look for a Java stack trace. If you do not understand it, edit your question and past in the stack trace (or the entire Gradle Console output). – CommonsWare Jan 07 '18 at 17:58
  • @CommonsWare, hey my friend in Console just show me above error! just show above error –  Jan 07 '18 at 18:00
  • I feel very confident that there is more in the Gradle Console than just those lines. See [this question](https://stackoverflow.com/q/46982823/115145) for a stack trace that Gradle might log to the Gradle Console. – CommonsWare Jan 07 '18 at 18:01
  • @CommonsWare, hey my friend I know what is stack trace. but just show me this **2lines :** `Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex` –  Jan 07 '18 at 18:07
  • My guess is that you are looking at the Messages tool, not the Gradle Console tool. Regardless, without the stack trace from Gradle, I cannot help you further. – CommonsWare Jan 07 '18 at 18:13

0 Answers0