저는 안드로이드 스튜디오니다. 을 만들었으로 새로운 프로젝트를 컴파일 내 모듈도 사용할 수 있지만 응용 프로그램을 실행하지 않았을 시작으로 메시지:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.안드로이드.빌더입니다.료 더싱시.DexArchiveMergerException:할 수 없습을 병합하는 덱스
하지만 나는't 는 방법을 알고 이를 해결하기 위해 오류가 있습니다. I googled 시간이지만 성공했다.
내 프로젝트 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'
}
____을 찾는_____
지 않았을 때 가져오는 두 번째 모듈(parser)응용 프로그램은 충돌하지 않았다에 덱스러면 모듈을 가져오지 않았습램이 작동하지 않았습니다. :D:D
때때로 당신은 당신만을 제거해야경고과는 오류자동으로 사라진 것입니다. 아래 참고 특별한 경우:
나는 이러한 두 가지 종속에서 나의 모듈을 수준니다.gradle
file:
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
고 Studio경고했(외에 덱스 병합한 문제는):
모두 com.안드로이드.지원
라이브러리를 사용해야 합니다 정확히 동일한 사양 버전(혼합 버전으로 이어질 수 있습 런타임 충돌). 발전27.0.2
,21.0.3
. 예로는com.안드로이드.지원:애니메이션-벡터-drawable:27.0.2
과com.안드로이드.지원:지원-v4:21.0.3
도록 명시적으로 결정된 버전의 com.안드로이드.지원:지원-v4`(참조하십시오 여기서]1for details)모두 문제가(경고와 관련된 덱스 병합)해결:
implementation 'com.android.support:support-v4:27.0.2' // Added this line (according to above warning message)
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
※아래 참조 의견에 대한 다른 유사한 상황입니다.*
제 경우에는 불행하게도,Michel's 도 Suragch's 솔루션은 나를 위해 일했습니다.
그래서 나는이 문제를 해결을 수행하여 다음과 같다:
에서gradle:3.0**를 컴파일구성은 이제 사용되지 않으로 교체해야implementation나api. 더 자세한 내용은여기를 읽을 읽을 수 있는 공식 문서에서Gradle 빌드 도구
컴파일을 구성이 여전히 존재 하지만 사용할 수 없습니다 그것이 제공되지 않을 보장하는 api 를 구현 구성을 제공합니다.
it's 를 사용하는 것이 좋implementation나api보*컴파일***
대체*컴파일※구현,debugCompile 서**debugImplementation,testCompile 서**testImplementation과androidtestcompile 서**androidTestImplementation**
예를 들어 대신에 이
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'
이
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.github.bumptech.glide:glide:4.0.0'
그 후
-를 삭제합니다.gradle 폴더 안에 당신의 프로젝트(이하기 위해,참조하십시오.gradle,당신이 필요로 전환하려면"프로젝트를"탐색기에서 왼쪽 상단에있) -모든폴더를 구축고 gradle 캐시입니다. -빌드 메뉴에서 누청소 프로젝트버튼입니다. -후이 완료된 작업을 누릅프로젝트를 재 구축에서 버튼을 구축하는 메뉴입니다.
그것을 희망하는 데 도움이됩니다!
저는 모든 다른 솔루션,하지만 아무도 나를 위해 일했습니다. 끝에서,나는 그것을 해결을 사용하여 동일한 의존 버전을 편집하여니다.gradle
. 나는 생각이 문제가 occurres 추가 할 때 라이브러리로 gradle 사용하는 다른 의존 버전의 지원이나 google 라이브러리입니다.
다음 코드를 추가하여 귀하의 건축 gradle 파일입니다. 다음깨끗
과다시
프로젝트입니다.
ps:는 오래된 솔루션을 나를 위해서 사용해야 합 업데이트 버전 다음과 같은 라이브러리입니다.
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.1.0'
}
} else if (requested.group == "com.google.android.gms") {
details.useVersion '11.8.0'
} else if (requested.group == "com.google.firebase") {
details.useVersion '11.8.0'
}
}
}
는 경우(1. 를 정리하려고 노력하고 다시 일)좋은 다음
다른 경우(2. 을 제거하려고 gradle 일)좋은 다음
다른 사람->3. 를 추가하려고 급료입니다.성
android.enableD8 = false
다른 사람->4. 추가multiDexEnabled
진실을 빌드.gradle
android {
compileSdkVersion 26
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 26
multiDexEnabled true
...
}
}
과 종속성을 추가
dependencies {
compile 'com.android.support:multidex:1.0.1'}
할 수 있는 첫 번째 하나의 작품에 대한 u 그래서 그러나 그것은 정말 특성에 따라 달라집의 문제는 나를 위해 예를 들어
내가 가지고 오류에 한 번 추가 이 라이브러리
implementation 'com.jjoe64:graphview:4.2.2'
그리고 나중에 내가 발견되었는지 확인하가 동일한 버전의 지원 라이브러리가 들어 있습니다. 그래서 시도해야합니다 또 다른 버전
compile 'com.jjoe64:graphview:4.2.1'
고 그것을 문제를 해결합니다. 그래서 주목한다.
다만 추가하여 위의 솔루션:
지 확인하는't 가 중복된 종속성을 가리키는 다른 버전에서,그들이 여러 장소(또는 심지어 같은 파일에서).
안녕하세요 같은 문제는 거의 모든 노. 그래서,마침내 내가 해결된 후에는 6 시간 긴 투쟁으로 디버깅 모든 것을 줄 수 있습니다.
classpath 'com.google.gms:google-services:3.0.0'
Google 서비스를 3.0지 않't support 중포 기지로 스튜디오 3.0playServiceVersion:11.6.0 또는 적습니다.
implementation "com.google.firebase:firebase-messaging:$rootProject.ext.playServiceVersion"
implementation "com.google.firebase:firebase-core:$rootProject.ext.playServiceVersion"
implementation "com.firebase:firebase-jobdispatcher-with-gcm-dep:$rootProject.ext.jobdispatcherVersion"
솔루션:
나는 변경google 서비스하기
classpath 'com.google.gms:google-services:3.1.1'
그 중포 기지 지원 서비스입니다.
희망은 누군가가 그/그녀의 시간입니다.
이 오류가 등장한 후에 당신을 포함하여 코 틀린지원,전혀 다른 솔루션 작업을 변경해 보십시오 틀린의 의존성 응용 프로그램 모듈's니다.gradle
하기:
implementation ("org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version") {
exclude group: 'org.jetbrains', module: 'annotations'
}
이것이 나를 위해서 안드로이드 스튜디오 3.0 베타 6. 볼[이](https://stackoverflow.com/a/46531584/6346531 가)응답에 대한 추가적인 설명했다.
가능성 중 하나입니다:의 존재는 동일한 라이브러리에 있지만 서로 다른 버전의 종속성을.
나는 이 문제는 다음과 같은 줄에 gradle file:
-컴파일 fileTree(include:['*.jar'],dir:'libs')
-컴파일'com.구글이다.코드입니다.코드:코드:2.8.2'
는 코드 라이브러리에서 내 라이브러리 디렉토리지만 이전 버전입니다.
삭제gson-2.3.1.jar 에서
라이브러리 디렉토리와 모든 것이 정상으로 돌아왔다.
[할 수 없습을 병합하는 해결 덱스] 후에는 시간의 스택이 넘치 나는 해결"할 수 없습을 병합하는 덱스 오"
원인-안드로이드가 업데이트 지원 라이브러리를 v27.1.0 다,그래서 당신이 변화하는 모든 안드로이드 지원선에 당신의 gradle 파일을 27.1.0 에서 26.1.0
allprojects{ 저장소{ jcenter() maven{ url"https://maven.google.com" } } }
원인은:-안드로이드 업데이트할 수 없습니다 지원 라이브러리에서 도구를 제공합니다.그리고 지금 그것을 사용하는 maven.google.com 를 업데이트하는,그래서 당신은 포함하는 이를 사용하 27.1.0 지원 라이브러리
후 변화 버전:
안드로이드 스튜디오 3.0 안정 빌드아래 단계를 나를 위해 일했:
동의함으로 크리스-주니어를 사용하는 경우 중포 기지를 포함하 몹 광고(거나 심지어 있지 않은 경우)재생 서비스-분석을 포함 플레이스 서비스-광고지't 추가하는 것으로 의미할 수 있습니다. 구글은 물론 실수에서 자신의 11.4.0 롤적으로 분석을 포함하여 버전 10.0.1 의 광고지,11.4.0(마우스 이상에서 힌트를 gradle 보여 줍니다).
나는 수동으로 추가컴파일'com.구글이다.안드로이드.gms:재생 서비스-광고:11.4.0'상단에있는이 일했지만,후에 나가 장애인을 즉시 실행: https://stackoverflow.com/a/35169716/530047
그래서 하나 퇴보를 10.0.1 또는 추가 광고 및 사용 안 함을 즉시 실행합니다. 는's 무엇을 발견하면 도움이 됩니다.