Android - 无法在添加Glide库时合并dex

时间:2018-05-14 18:44:11

标签: android android-gradle

添加Glide库后,我会遇到异常。对此有何解决方案? (我试图清理和重建项目)

  

错误:任务执行失败   ':应用程序:transformDexArchiveWithExternalLibsDexMergerForDebug'。    java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并   DEX

的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.myyoutubeapp.myyoutubeapp"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:support-vector-drawable:26.1.0'
    implementation 'com.android.support:support-annotations:27.1.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.android.support:support-v13:26.1.0'
    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'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
    //implementation 'com.marshalchen.ultimaterecyclerview:library:0.7.3'
}

0 个答案:

没有答案