0

I am working with firebase database .I was update the dependence .Then it in not working and showing me this Error

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

I updated my sdk version

compileSdkVersion 27

//buildToolsVersion '26.0.2'
buildToolsVersion '27.0.3'
//buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "com.example.hasib.foodapplication"

    minSdkVersion 22
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    multiDexEnabled = true

This is my firebase tools dependence.Which i found from firebase document site.

compile 'com.google.firebase:firebase-core:16.0.0'
compile 'com.google.firebase:firebase-storage:16.0.1'
compile 'com.google.firebase:firebase-auth:16.0.1'
compile 'com.google.firebase:firebase-database:16.0.1'
compile 'com.google.firebase:firebase-messaging:17.0.0'

This is play service dependence

 implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-gcm:15.0.1'

This is my project gradle

 dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'

    classpath 'com.google.gms:google-services:4.0.1'
}

This is Android database ui

 compile 'com.firebaseui:firebase-ui-database:4.0.0'

I don't know how to solve this error. I googled this for hours but with no success.

Hasib Akon
  • 3
  • 1
  • 5

1 Answers1

0

First of all, please change all dependencies either to compile or implementation depending on your android studio version. Next there is a dependency for multidex please do add it and let me know if that works ?

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

Raj
  • 2,997
  • 2
  • 12
  • 30