无法在运行Android应用程序上合并dex

时间:2017-12-02 20:31:36

标签: android gradle

我尝试运行我的应用程序,但突然出现此错误

错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'执行失败。

  

java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex

然后我尝试搜索并尝试该解决方案,但所有解决方案都无效 帮帮我:(

这是我的.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.2'
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
    defaultConfig {
        applicationId 'com.inhatc.jh.yourplaylist'
        minSdkVersion 20
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    useLibrary 'org.apache.http.legacy'
    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'
    })
    compile files('libs/jaudiotagger-2.2.4-SNAPSHOT.jar')
    compile files('libs/glide-3.4.0.jar')
    compile files('libs/google-api-services-youtube-v3-rev183-1.22.0.jar')
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.google.android.gms:play-services-auth:10.0.1'
    // Google Api Client library and Android extension
    compile 'com.google.api-client:google-api-client-android:1.22.0'
    // Change to the API you want to access:
    // Below is just an example for People REST API access
    compile 'com.google.apis:google-api-services-people:v1-rev4-1.22.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

1 个答案:

答案 0 :(得分:0)

今天解决了我的问题 我想念lib / .jar文件和.gradle依赖项