将Android Studio 2.3.3更新为3.0后无法合并dex

时间:2017-10-30 06:31:20

标签: android android-studio android-gradle

Android Studio 3.0更新后无法合并dex。 我还尝试了stackoverflow中的这么多旧问题: -

但它不适合我。

  

失败:构建因异常而失败。

     

出了什么问题:任务执行失败   ':应用程序:transformDexArchiveWithExternalLibsDexMergerForDebug'

     
    

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

  

我的app gradle文件如下: -

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.example"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 5
        versionName "1.4"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        multiDexEnabled true

        manifestPlaceholders = [onesignal_app_id: "One Signal Key",
                                onesignal_google_project_number: "REMOTE"]
    }

    lintOptions {
        checkReleaseBuilds false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile files('libs/acra-4.5.0.jar')
    compile files('libs/signpost-commonshttp4-1.2.1.1.jar')
    compile files('libs/signpost-core-1.2.1.1.jar')
    compile files('libs/signpost-jetty6-1.2.1.1.jar')
    compile files('libs/twitter4j-core-2.1.6.jar')
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:26.1.0'
    compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
    compile 'com.intuit.sdp:sdp-android:1.0.4'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.google.android.gms:play-services:11.0.2'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:customtabs:26.1.0'
    compile 'com.android.support:palette-v7:26.1.0'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    compile 'com.github.amlcurran.showcaseview:library:5.4.3'
    compile 'com.google.android.exoplayer:exoplayer:r1.5.7'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
}

1 个答案:

答案 0 :(得分:0)

删除此声明: multiDexEnabled true