Android - Невозможно объединить Dex - PullRequest
0 голосов
/ 22 марта 2020

Я создаю android приложение, в котором у меня возникла проблема с запуском приложения

Я получаю следующую ошибку

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Я согласен, что это общий вопрос через стекопоток, но решение состояло в том, что нам нужно объявить multiDexEnabled true, но он не работает для меня.

Ниже приведен модуль моего приложения build.gradle

apply plugin: 'com.android.application'


configurations.all {

    /* resolutionStrategy {
         force 'com.android.support:support-annotations:28.0.0'
         force 'com.android.support:support-v4:28.0.0'
     }*/

}
android {
    compileSdkVersion 28


    defaultConfig {
        applicationId "kindness.delivered.karunai"
        minSdkVersion 27
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.google.android.libraries.places:places:2.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    compile 'com.android.support:multidex:1.0.1'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support:support-annotations:28.0.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'android.arch.lifecycle:extensions:1.1.1'


}

И проект Уровень build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

   /* repositories {
        google()
        jcenter()
    }*/
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Пожалуйста, помогите мне найти решение.

...