1

Android Studio 3.0 Unable to merge dex after updating. And i also tried so many old question from stackoverflow :-

but it not works for me.

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

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

And my app gradle file is give below:-

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.example"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 5
        versionName "1.4"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        multiDexEnabled true

        manifestPlaceholders = [onesignal_app_id: "One Signal Key",
                                onesignal_google_project_number: "REMOTE"]
    }

    lintOptions {
        checkReleaseBuilds false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile files('libs/acra-4.5.0.jar')
    compile files('libs/signpost-commonshttp4-1.2.1.1.jar')
    compile files('libs/signpost-core-1.2.1.1.jar')
    compile files('libs/signpost-jetty6-1.2.1.1.jar')
    compile files('libs/twitter4j-core-2.1.6.jar')
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:26.1.0'
    compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
    compile 'com.intuit.sdp:sdp-android:1.0.4'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.google.android.gms:play-services:11.0.2'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:customtabs:26.1.0'
    compile 'com.android.support:palette-v7:26.1.0'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    compile 'com.github.amlcurran.showcaseview:library:5.4.3'
    compile 'com.google.android.exoplayer:exoplayer:r1.5.7'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
}
Shubham Sejpal
  • 3,556
  • 2
  • 14
  • 31
  • have you tried to update the multi dex lib to 'com.android.support:multidex:1.0.2' – AbuQauod Oct 30 '17 at 06:36
  • After your suggestion i tried that also but they can't work for me. – Shubham Sejpal Oct 30 '17 at 06:38
  • have u done the changes in google repo and gradle wrapper versions? also have u extended Application class? are used the default Application namespace priovided for multidex and related changes? – Niraj Sanghani Oct 30 '17 at 06:41
  • it give me the error after entering one-signal dependencies but i can't able to solve that error and even i can't able to remove it from the project. for trial i put it in comment than other thing will working fine without any kind of error – Shubham Sejpal Oct 30 '17 at 06:43

1 Answers1

0

delete this statement: multiDexEnabled true

Liu
  • 1