nexus 5 기기에서 프로젝트를 만들고 실행할 때 제대로 작동합니다. apache 오류 : 'app : transformClassesWithJarMergingForDebug'작업 실행에 실패했습니다. > com.android.build.api
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lorg/apache/http/Consts;
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
다음 내 Gradle을에
multiDexEnabled true
을 추가하지만, 내가 구축하고 내 삼성 GT-I9100 (API 16)에 프로젝트를 실행할 때의 오류를 보여줍니다. 다시 컴파일하려고하면 다음과 같은 오류 메시지가 나타납니다. 오류 : 'app : transformClassesWithDexForDebug'작업 실행에 실패했습니다.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lorg/apache/http/Consts;
그러나 다시, 내가 내 넥서스 5 (API 23)
내 응용 프로그램 Gradle을 파일을 컴파일 할 때 제대로 작동 당신은 귀하의 Gradle을에 종속성을 추가해야
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.project.example"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
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 'com.android.support:multidex:1.0.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.android.support:design:25.1.1'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
testCompile 'junit:junit:4.12'
}
이 등급의 파일을 게시 – Umarov
@Umarov 대신 응용 프로그램 클래스에
MultiDexApllication
를 확장해야 확인해 봐. 나는 그들을 편집했습니다 – VincentTheonardo