Android Studio Beta가 있습니다. 이전 모듈을 컴파일하여 새 프로젝트를 만들었지 만 앱을 시작하려고 할 때 메시지와 함께 시작되지 않았습니다.
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException : 덱스를 병합 할 수 없습니다
그러나이 오류를 해결하는 방법을 모르겠습니다. 나는 이것을 몇 시간 동안 봤지만 성공하지 못했습니다.
내 프로젝트 gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
classpath "io.realm:realm-gradle-plugin:3.7.1"
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
내 앱 gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "parad0x.sk.onlyforyou"
minSdkVersion 21
targetSdkVersion 26
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'
}
debug {
}
}
compileOptions {
targetCompatibility 1.7
sourceCompatibility 1.7
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
lintOptions {
checkReleaseBuilds false
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile project(path: ':loginregisterview')
}
그리고 내 모듈 gradle :
apply plugin: 'com.android.library'
apply plugin: 'realm-android'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.github.bumptech.glide:glide:4.0.0'
testCompile 'junit:junit:4.12'
compile project(path: ':parser')
}
내 두 번째 모듈 :
apply plugin: 'com.android.library'
apply plugin: 'realm-android'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
realm {
syncEnabled = true
}
useLibrary 'org.apache.http.legacy'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile 'junit:junit:4.12'
// compile 'com.android.support:appcompat-v7:23.1.0'
// compile 'com.fasterxml.jackson.core:jackson-core:2.9.0'
// compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0'
// compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0'
compile 'com.google.code.gson:gson:2.6.2'
}
____________발견_________
두 번째 모듈 (파서)을 가져 오지 않으면 응용 프로그램이 dex에서 충돌하지 않았지만 모듈을 가져 오지 않은 경우 응용 프로그램이 작동하지 않았습니다. : D : D