0

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibs Dex MergerForDebug

I encountered this error when I reset the Source Code that I purchased...

And i use android studio 3.0.1

What's the solution? plz i need help

    apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
buildscript {
    repositories {
        maven { url "https://github.com/omadahealth/omada-nexus/raw/master/release" }
        maven { url "https://jitpack.io" }
    }

    dependencies {


    }
}

android {
    signingConfigs {
        config {

        }
    }
    lintOptions {
        abortOnError false
    }

    dataBinding {
        enabled = true
    }

    compileSdkVersion 27
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.mohammad.debo"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 5
        versionName "1.3"
        multiDexEnabled true
    }
    buildTypes {
        release {
            ext.enableCrashlytics = true
            //shrinkResources false
            //minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            //debuggable false
            //jniDebuggable false
            signingConfig signingConfigs.config
            //zipAlignEnabled true
        }
        debug {
            //debuggable true
            ext.enableCrashlytics = true
            //minifyEnabled false
            //shrinkResources false
            //renderscriptDebuggable false
            //jniDebuggable false
            proguardFiles 'proguard-rules.txt'
            //signingConfig signingConfigs.debug
        }
    }

    packagingOptions {
        exclude 'META-INF/services/javax.annotation.processing.Processor'
        exclude 'META-INF/**'
        exclude 'META-INF/**'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    mavenCentral()
    jcenter()

}

android {
    dexOptions {
        jumboMode = true
        javaMaxHeapSize "4g"
    }

lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll

dependencies {
            compile fileTree(include: ['*.jar'], dir: 'libs')
            // Navigation Drawer Library
            compile('com.mikepenz:materialdrawer:5.3.0@aar') {
                transitive = true
            }

            //Google, Inc (Play services) Libraries

            implementation 'com.google.android.gms:play-services-places:11.8.0'
            implementation 'com.google.android.gms:play-services-maps:11.8.0'
            implementation 'com.google.android.gms:play-services-location:11.8.0'
            implementation 'com.google.android.gms:play-services-ads:11.8.0'
            implementation 'com.google.android.gms:play-services-auth:11.8.0'
            implementation 'com.google.firebase:firebase-core:11.8.0'
            implementation 'com.google.firebase:firebase-database:11.8.0'
            implementation 'com.google.firebase:firebase-crash:11.8.0'
            implementation 'com.google.firebase:firebase-auth:11.8.0'
            implementation 'com.google.firebase:firebase-messaging:11.8.0'
            implementation 'com.google.firebase:firebase-storage:11.8.0'
            implementation 'com.google.firebase:firebase-config:11.8.0'
            implementation 'com.google.firebase:firebase-appindexing:11.8.0'
            implementation 'com.google.android.gms:play-services-appinvite:11.8.0'

            //Google, Inc (Firebase) Libraries

            implementation 'com.firebase:firebase-jobdispatcher:0.6.0'
            implementation 'com.firebaseui:firebase-ui-database:2.3.0'
            implementation 'com.firebase:geofire-android:2.1.2'

            // Google, Inc (Support) Libraries

            implementation 'com.android.support:support-v13:27.0.2'
            //implementation 'com.android.support:customtabs:27.0.2'
            implementation 'com.android.support:cardview-v7:27.0.2'
            implementation 'com.android.support:support-v4:27.0.2'
            implementation 'com.android.support:design:27.0.2'
            implementation 'com.android.support:appcompat-v7:27.0.2'
            implementation 'com.android.support:multidex:1.0.2'
            implementation 'com.android.support:palette-v7:27.0.2'
            implementation 'com.android.support:support-vector-drawable:27.0.2'
            //implementation 'com.android.support.constraint:constraint-layout:1.0.2'

            // Facebook, Inc SDKs

        implementation 'com.facebook.android:facebook-android-sdk:4.29.0'

        // Libraries for images

        implementation 'de.hdodenhof:circleimageview:2.1.0'
        implementation 'com.github.bumptech.glide:glide:3.8.0'
        implementation 'com.lorentzos.swipecards:library:1.0.9'
        implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
        implementation 'com.vanniktech:emoji-twitter:0.5.1'
        implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
        implementation 'com.github.yalantis:ucrop:2.2.1'
        implementation 'com.github.jkwiecien:EasyImage:1.3.1'
        implementation 'jp.wasabeef:picasso-transformations:2.1.2'
        implementation 'com.squareup.picasso:picasso:2.5.2'

        // Location Helper Library

        implementation 'com.squareup.retrofit2:retrofit:2.2.0'
        implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'

        // Time library

        implementation 'joda-time:joda-time:2.9.9'
        implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'

______________________________________lllllllllllllllllllllllllllllllllllllll

            // Others
        // event bus
        implementation 'org.greenrobot:eventbus:3.0.0'
        implementation 'com.jakewharton:butterknife:8.8.1'
        implementation 'com.flipboard:bottomsheet-core:1.5.3'
        implementation 'com.flipboard:bottomsheet-commons:1.5.3'
        implementation 'com.greysonparrelli.permiso:permiso:0.3.0'
        implementation 'com.googlecode.libphonenumber:libphonenumber:8.5.2'
        implementation 'com.airbnb.android:lottie:2.2.5'

        annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    }
    apply plugin: 'com.google.gms.google-services'
  • Search well on SO. It's full of this questions. Anyway, the majority of these depends whether on enabling MultiDex or to wrong libraries inclusions (e.g. for versions, etc.). BTW you must paste also your build gradle files and the build gradle output full error if you want that someone get an useful clue for it. – shadowsheep Mar 15 '18 at 17:11
  • As a first sight you have the wrong firebase ui version. Check the site for the right one. There an helpful table. https://github.com/firebase/FirebaseUI-Android – shadowsheep Mar 15 '18 at 17:13
  • I used the latest version but I had errors – Mohammad Samer Mar 15 '18 at 17:18
  • Be sure to have multi dex enabled: https://developer.android.com/studio/build/multidex.html. – shadowsheep Mar 15 '18 at 17:20
  • Possible duplicate of [Unable to merge dex](https://stackoverflow.com/questions/46267621/unable-to-merge-dex) – shadowsheep Mar 15 '18 at 17:25

1 Answers1

0

As a first sight you have the wrong firebase ui version. Check the site for the right one. There an helpful table.

Try use firebase ui 3.2.2 or 3.1.3

For example:

implementation 'com.firebaseui:firebase-ui-database:3.1.3'

And pay attention to migration notes.

Update firebase-ui from version 2.4 or lower to 3.0 needs some refactoring:

Auth:

  • No major changes.

Database:

  • The API for all of the adapter classes has been completely revamped to be more flexible and easier to understand.

Firestore:

  • Support for the brand new database product, Cloud Firestore. See the product documentation for more information.

Storage:

  • Support for Glide version 4.0.0 and higher.

If only that doesn't work if you have updated some of your libraries version, try to checkout (do you have a versioning system like git I hope) the latest version that build and update your libraries one at a time. Remember that 'divide et impera' is on of the oldest and most useful among debug methods when I haven't a clue).

And be sure to have multi dex enable and make a fresh clean of your project.

shadowsheep
  • 14,048
  • 3
  • 67
  • 77
  • @MohammadSamer is the project under a version control system? Git, SVN. Do you have a version of your project that builds I guess ( and hope :) ). Get it and update the libraries one at a time, remember the association between firebase and firebase-ui. – shadowsheep Mar 15 '18 at 17:29
  • @MohammadSamer look also at this: https://stackoverflow.com/questions/46267621/unable-to-merge-dex and don't stop at the choosen solution, but read all scenarios. – shadowsheep Mar 15 '18 at 17:33