Search code examples
androidandroid-multidex

I am facing Multidex issue while running the app in Android studio 3.0 Beta 5


I have followed the various links for this solution but nothing worked. Below is the error:

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

I have also enabled multidex and have added google services plugin at bottom of build.gradle file.Here is the build.gradle compiler dependencies:

compile fileTree(include: '*.jar', dir: 'libs')
compile files('libs/universal-image-loader-1.9.5.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}

compile 'com.android.support:design:26.0.1'
compile 'com.android.support:mediarouter-v7:26.0.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:support-v13:26.0.1'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.+'
compile('com.googlecode.json-simple:json-simple:1.1.1') {
    exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile 'com.google.firebase:firebase-messaging:11.4.0'
compile 'junit:junit:4.12'
compile 'com.nineoldandroids:library:2.4.0'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.1.2'
testCompile 'org.robolectric:shadows-multidex:3.1.2'
testCompile 'org.robolectric:shadows-httpclient:3.1.2'
testCompile 'org.robolectric:shadows-support-v4:3.1.2'
compile files('libs/beacon_sdk.jar')
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile('org.apache.httpcomponents:httpmime:4.3') {
    exclude module: "httpclient"
}

compile 'com.google.android.gms:play-services:11.4.0'
compile 'com.google.firebase:firebase-core:11.4.0'
compile 'org.apmem.tools:layouts:1.10@aar'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'com.android.support:cardview-v7:26.0.1'

Solution

  • try this just split google play services it will worked

    use this

        compile 'com.google.android.gms:play-services-analytics:11.4.0'
        compile 'com.google.android.gms:play-services-drive:11.4.0'
        compile 'com.google.android.gms:play-services-location:11.4.0'
        compile 'com.google.android.gms:play-services-places:11.4.0'
        compile 'com.google.android.gms:play-services-gcm:11.4.0'
        compile 'com.google.android.gms:play-services-plus:11.4.0'
    

    insted of this

    compile 'com.google.android.gms:play-services:11.4.0'