Merge Dex Issue With Android Studio

My App is not bringing up an error:

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

This is y build gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
    applicationId "app.monmos"
    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.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-   core:2.2.2', {
    exclude group:'com.android.support', module: 'support-annotations'
})

//noinspection GradleCompatible
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-         core:3.0.1'
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.github.bumptech.glide:glide:4.0.0'


//Fixed Crash FButton
implementation ('com.github.jd-alexander:android-flat-button:v1.1')

//Libraries
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'


implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support:support-annotations:27.1.0'
implementation 'com.android.support:support-v13:27.1.0'
implementation 'com.google.android.gms:play-services:11.8.0'
testCompile 'junit:junit:4.12'

implementation 'com.android.support:cardview-v7:26.+'
implementation 'com.android.support:recyclerview-v7:26.+'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'

}
apply plugin: 'com.google.gms.google-services'

implementation 'com.android.support:support-v4:26.1.0'

Is having conflicts with:

implementation 'com.android.support:support-v13:27.1.0'

You can't have 2 versions of the same library. Either use one or the other.

Or you can add in your module's Build.Gradle:

android {
    ...
    defaultConfig {
        ...
        multiDexEnabled = true
    }
...
}

It should solve the problem.

Let me know how it turns out.

链接地址: http://www.djcxy.com/p/85304.html

上一篇: Kotlin无法编译一个库

下一篇: 通过Android Studio合并Dex问题