-1
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.souravsaikia.chattingapp"
        minSdkVersion 23
        targetSdkVersion 26
        multiDexEnabled true

        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:multidex:1.0.3'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:26.1.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    api 'com.theartofdev.edmodo:android-image-cropper:2.5.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.firebaseui:firebase-ui-database:4.2.1'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.google.android.gms:play-services-auth:16.0.1'

}


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

This is the app level gradle file. Also here is the code for project level gradle.

buildscript {

    repositories {
        apply plugin: 'announce'
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
    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
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

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

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

Sorry to repeat the same question. But I have gone through most of the answers here. But still could not find the appropriate solution for the problem. I have been stuck in this problem for two days. So help would be appreciated.

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

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

Knightbarron
  • 35
  • 2
  • 10

1 Answers1

0

I changed compileSdkVersion to 27 and targetSdkVersion to 27. Also the appcompat,design and recyclerView dependencies to 27.1.1. It worked for me.

Knightbarron
  • 35
  • 2
  • 10