0

I'm getting the error "Unable to merge dex". I started getting this error when I added the last implementation. I've tried cleaning, rebuilding and enabling multidex but nothing helped.

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() }
Zoe
  • 27,060
  • 21
  • 118
  • 148

1 Answers1

0

Enable MultiDex in your build.gradle (Module:app) (MultiDex allows compiling code-base with over 65,536 methods, most of them are third party API, jar etc.)

multiDexEnabled true

just as first line after:

    android {
        defaultConfig {

example:

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'
        }
    }
}
Java bee
  • 2,522
  • 1
  • 12
  • 25