gpt4 book ai didi

android - java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex时出错

转载 作者:行者123 更新时间:2023-12-03 04:51:05 25 4
gpt4 key购买 nike

嗨,我正在为我的android应用程序使用MVVM设计模式。

当我添加implementation android.arch.lifecycle:extensions:$project.lifecycle" kapt "android.arch.lifecycle:compiler:$project.lifecycle"

我低于错误

com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException:



我阅读了多个线程 Unable to merge dex进行修复,但对我而言不起作用。
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.app.android"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
debug {
// set build config here for debug builds
buildConfigField("String", "BASE_URL", "\"http://52.15.45.102\"")
}
release {
// set build config here for release builds
buildConfigField("String", "BASE_URL", "\"http://52.15.45.102\"")
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

dataBinding {
enabled = true
}
}

project.ext {
daggerVersion = "2.11"
anko_version = '0.10.1'
roomDatabase = '1.0.0-alpha3'
lifecycle = '1.0.0-alpha3'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

implementation 'com.android.support:design:26.1.0'

implementation "org.jetbrains.anko:anko-commons:$project.anko_version"

implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation "com.squareup.retrofit2:converter-moshi:2.0.0"

// Dagger core
kapt "com.google.dagger:dagger-compiler:$project.daggerVersion"
implementation "com.google.dagger:dagger:$project.daggerVersion"

// Dagger Android
kapt "com.google.dagger:dagger-android-processor:$project.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$project.daggerVersion"
// if you are not using support library, include this instead
implementation "com.google.dagger:dagger-android:$project.daggerVersion"


implementation 'com.github.bumptech.glide:glide:4.0.0'
kapt 'com.github.bumptech.glide:compiler:4.0.0'

implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.5'

// Database
//implementation "android.arch.persistence.room:rxjava2:$project.roomDatabase"
//kapt "android.arch.persistence.room:compiler:$project.roomDatabase"

// Viewmodel
implementation "android.arch.lifecycle:extensions:$project.lifecycle"
kapt "android.arch.lifecycle:compiler:$project.lifecycle"

// new version 1.5.2 has some multi dex issue
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'

// Databinding
kapt "com.android.databinding:compiler:$gradle_version"

// Multidex
implementation 'com.android.support:multidex:1.0.2'

implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.0.2', {
exclude module: 'support-v4'
}

implementation("org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version") {
exclude group: 'org.jetbrains', module: 'annotations'
}

}

项目build.gradle
buildscript {
ext.kotlin_version = '1.1.51'
ext.gradle_version = '3.0.0-beta7'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0-alpha01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

AppPartnerApplication.kt
class AppPartnerApplication : Application(), AnkoLogger, HasActivityInjector {

@Inject lateinit var activityInjector: DispatchingAndroidInjector<Activity>

override fun activityInjector(): AndroidInjector<Activity> {
return activityInjector
}

override fun onCreate() {
super.onCreate()
DaggerAppComponent.create().inject(this)
}

override protected fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
MultiDex.install(this)
}

}

错误
$ gradlew build

> Configure project :app
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\android-ndk-r15.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

Observed package id 'add-ons;addon-google_apis-google-22' in inconsistent location 'C:\Users\williams\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-22-1' (Expected 'C:\Users\williams\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-22')
Observed package id 'add-ons;addon-google_apis-google-23' in inconsistent location 'C:\Users\williams\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23-1' (Expected 'C:\Users\williams\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23')
app: 'androidProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.0-alpha01'.

> Task :app:kaptGenerateStubsDebugKotlin
Using Kotlin incremental compilation

w: warning: Supported source version 'RELEASE_7' from annotation processor 'android.arch.lifecycle.LifecycleProcessor' less than -source '1.8'
w:

w: D:\android\apppartnerandroid\appandroid\app\src\main\java\com\appandroid\android\data\remote\CallbackWrapper.kt: (45, 39): No cast needed
w: D:\android\apppartnerandroid\appandroid\app\src\main\java\com\appandroid\android\login\LoginViewModel.kt: (36, 15): Parameter 'view' is never used

> Task :app:compileDebugKotlin
Using Kotlin incremental compilation

> Task :app:transformClassesWithDexBuilderForDebug
D8 is used to build dex.

> Task :app:transformDexArchiveWithDexMergerForDebug
D8 is used to merge dex.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\51, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\52, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\53, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\0.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\1.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\2.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\3.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\4.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\5.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\6.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\7.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\8.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\9.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\10.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\11.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\12.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\13.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\14.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\15.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\16.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\17.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\18.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\19.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\20.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\21.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\22.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\23.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\24.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\25.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\26.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\27.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\28.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\29.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\30.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\31.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\32.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\33.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\34.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\35.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\36.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\37.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\38.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\39.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\40.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\41.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\42.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\43.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\44.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\45.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\46.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\47.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\48.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\49.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\50.jar

at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinTask.externalAwaitDone(ForkJoinTask.java:326)
at java.util.concurrent.ForkJoinTask.doJoin(ForkJoinTask.java:391)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:719)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:397)
at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:225)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at sun.reflect.GeneratedMethodAccessor488.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\51, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\52, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\53, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\0.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\1.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\2.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\3.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\4.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\5.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\6.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\7.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\8.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\9.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\10.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\11.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\12.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\13.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\14.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\15.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\16.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\17.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\18.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\19.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\20.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\21.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\22.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\23.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\24.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\25.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\26.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\27.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\28.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\29.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\30.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\31.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\32.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\33.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\34.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\35.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\36.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\37.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\38.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\39.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\40.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\41.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\42.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\43.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\44.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\45.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\46.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\47.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\48.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\49.jar, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\50.jar

at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:96)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:82)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:97)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:35)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
... 54 more
Caused by: com.android.tools.r8.errors.CompilationError: Program type already present: android.arch.core.internal.SafeIterableMap
at com.android.tools.r8.utils.ProgramClassCollection.resolveClassConflictImpl(ProgramClassCollection.java:61)
at com.android.tools.r8.utils.ProgramClassCollection.lambda$create$44(ProgramClassCollection.java:22)
at java.util.Map.merge(Map.java:1175)
at com.android.tools.r8.utils.ProgramClassCollection.create(ProgramClassCollection.java:22)
at com.android.tools.r8.graph.LazyLoadedDexApplication$Builder.build(LazyLoadedDexApplication.java:114)
at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:93)
at com.android.tools.r8.D8.runForTesting(D8.java:175)
at com.android.tools.r8.D8.runForTesting(D8.java:149)
at com.android.tools.r8.D8.run(D8.java:68)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:80)
... 57 more



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\51, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\52, D:\android\apppartnerandroid\appandroid\app\build\intermediates\transforms\dexBuilder\debug\53....

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 20s
25 actionable tasks: 25 executed

最佳答案

尝试是否可以更新android体系结构组件版本,然后查看进展情况。

implementation "android.arch.lifecycle:extensions:1.0.0"

关于android - java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47123841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com