0
將com.android.support:leanback-v17
庫添加到我的Gradle依賴項時,我得到DexArchiveMergerException
。我的supportLibraryVersion
是26.0.1
。添加Leanback庫時獲取DexArchiveMergerException
我的依賴關係是:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:support-v4:$rootProject.supportLibraryVersion"
implementation "com.android.support:palette-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:mediarouter-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:leanback-v17:$rootProject.supportLibraryVersion"
implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintVersion"
implementation "com.squareup.picasso:picasso:$rootProject.picassoVersion"
implementation "com.squareup.okhttp3:okhttp:$rootProject.okhttpVersion"
implementation "de.hdodenhof:circleimageview:$rootProject.circleimageviewVersion"
implementation "com.android.volley:volley:$rootProject.volleyVersion"
implementation "com.google.android.exoplayer:exoplayer-core:$rootProject.exoplayerVersion"
implementation "com.google.android.exoplayer:exoplayer-ui:$rootProject.exoplayerVersion"
implementation "com.google.android.exoplayer:exoplayer-hls:$rootProject.exoplayerVersion"
implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"
implementation "com.jakewharton:butterknife:$rootProject.butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterknifeVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxJavaVersion"
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxJavaVersion"
implementation "com.google.android.gms:play-services-cast:$rootProject.playServicesVersion"
implementation "com.google.android.gms:play-services-cast-framework:$rootProject.playServicesVersion"
implementation "com.google.android.gms:play-services-ads:$rootProject.playServicesVersion"
implementation "com.google.android.gms:play-services-auth:$rootProject.playServicesVersion"
implementation "com.google.firebase:firebase-messaging:$rootProject.playServicesVersion"
testImplementation "junit:junit:$rootProject.junitVersion"
}
我收到以下錯誤:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
如何解決這個問題?
https://stackoverflow.com/questions/23025433/how-to-clear-gradle-cache –