无法在我的Android Studio文件中合并dex错误

问题描述 投票:0回答:1

我收到错误“无法合并dex”。当我添加最后一个实现时,我开始收到此错误。我尝试过清理,重建和启用multidex,但没有任何帮助。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        multiDexEnabled true
        applicationId "com.wovasoft.iowe"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

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

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.parse:parse-android:1.16.7'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.github.tgio:parse-livequery:1.0.3' }

repositories {
    mavenCentral() }
java android android-gradle
1个回答
0
投票

在build.gradle中启用MultiDex(Module:app)(MultiDex允许使用超过65,536种方法编译代码库,其中大多数是第三方API,jar等)

multiDexEnabled true

就像第一行之后:

    android {
        defaultConfig {

例:

android {
    compileSdkVersion 28
    defaultConfig {
        multiDexEnabled true
        applicationId "com.yourpackage"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.