由以下原因引起:com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错

时间:2019-05-17 06:35:18

标签: android gradle

当我运行project ..或清理并重建项目时,出现了4个错误

  

由以下原因引起:java.lang.RuntimeException。   com.android.builder.dexing.DexArchiveMergerException:时出错   合并dex归档文件:引起原因:   com.android.builder.dexing.DexArchiveMergerException:时出错   合并dex归档文件:引起原因:   com.android.tools.r8.CompilationFailedException:编译失败   引起原因:com.android.tools.r8.utils.AbortException:错误:程序   类型已经存在:com.bumptech.glide.Glide   我还在defaultConfig标记中复制了multiDexEnabled true。

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
/*implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60"*/
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
implementation 'com.android.support:design:28.0.0'
implementation 'net.rimoto:intlphoneinput:1.0.1'
implementation 'com.hbb20:ccp:2.2.3'
implementation 'com.github.florent37:materialtextfield:1.0.7'
implementation 'com.airbnb.android:lottie:2.2.5'
implementation 'com.daimajia.easing:library:2.0@aar'
implementation 'com.daimajia.androidanimations:library:2.3@aar'
implementation 'com.facebook.android:facebook-login:[4,5)'
implementation 'de.hdodenhof:circleimageview:3.0.0'


// retrofit, gson
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'io.reactivex.rxjava2:rxjava:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
// Volley
implementation 'com.android.volley:volley:1.1.1'
implementation 'org.sufficientlysecure:html-textview:3.6'


// fire base core
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.irozon.mural:mural:1.0.1'
implementation 'com.github.zetbaitsu:Compressor:31d924ea86'
// FCM messaging
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'


implementation 'com.yarolegovich:discrete-scrollview:1.4.9'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.yarolegovich:mp:1.0.9'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.libraries.places:places-compat:1.1.0'
implementation 'com.android.support:multidex:1.0.3'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'}

如果有人遇到相同问题,请提出建议。

1 个答案:

答案 0 :(得分:-1)

好吧,这个问题很棘手,所以我无法解决这个问题,但是我所做的是我迁移到android x,然后将其添加到实现中

('com.github.bumptech.glide:glide:4.9.0'){ exclude group: "com.android.support" }

看看它是否可以运行,我也已经添加了

annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0

我并不是说这些方法可以工作,但确实值得一试,因为老实说,我在gradle.app中弄乱了我的版本,也花了我几天的时间来解决这个问题。