合并dex时出错

时间:2018-04-24 07:10:13

标签: android

无法合并dex

  

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

build.grandle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
//    buildToolsVersion "27.1.1"
    defaultConfig {
        applicationId "com.osan.user.askprediction"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 3
        versionName "1.1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation('com.payumoney.sdkui:plug-n-play:1.0.0') {
        transitive = true;
        exclude module: 'payumoney-sdk'
    }
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.google.android.gms:play-services-places:15.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.payumoney.core:payumoney-sdk:7.0.1'
    testCompile 'junit:junit:4.12'
    implementation files('libs/okhttp-2.5.0.jar')
    implementation files('libs/okio-1.6.0.jar')
    implementation 'com.dinuscxj:circleprogressbar:1.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.paytm:pgplussdk:1.1.2'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
}
configurations {
    all*.exclude group: 'com.android.volley'
}
apply plugin: 'com.google.gms.google-services'

2 个答案:

答案 0 :(得分:1)

android {
    defaultConfig {
       multiDexEnabled true
    }
}

在你的 应用/的build.gradle

答案 1 :(得分:1)

在依赖项中添加此库

compile 'com.android.support:multidex:1.0.1'