Android multiDexEnabled ошибка - PullRequest
0 голосов
/ 02 июня 2018
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.example.mhmdalmz.unfollowsky"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        multiDexEnabled true
        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'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    compile 'org.brunocvcunha.instagram4j:instagram4j:1.7'
}

Это моя бабушка.Я добавил multiDexEnabled true в defaultConfing, но мой проект не работает.Я не знаю почему.В чем моя ошибка?

LogCat;

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

1 Ответ

0 голосов
/ 02 июня 2018

Настройка 'multiDexEnabled true' сама по себе не будет работать ниже API 21

. Вы должны добавить следующую зависимость.

implementation 'com.android.support:multidex:1.0.3'

В качестве альтернативы вы можете установить minSdkVersion равным 21

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...