I use Android Studio version 3.0.1. My project showed up the Unable to merge dex.
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
I had tried
method A:
1.clean project
2.rebuild project
method B:
android {
defaultConfig {
multiDexEnabled true
}
}
But still not working :(
Here are my gradle file setting can anyone help me to check the problem? thx!
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
multiDexEnabled true
applicationId "edu.berkeley.calhacks.pictureperfect"
minSdkVersion 21
targetSdkVersion 16
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:25.1.0'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.android.support:design:25.1.0'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile "org.apache.httpcomponents:httpmime:4.2.3"
compile 'com.android.support:multidex:1.0.1'
}