-5

The error :

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

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

enter image description here

Gowthaman M
  • 8,057
  • 8
  • 35
  • 54
  • Have you enabled multidexing – Ashish Pardhiye Mar 14 '18 at 09:59
  • 2
    Possible duplicate of [Android Studio 3.0 Execution failed for task: unable to merge dex](https://stackoverflow.com/questions/47079113/android-studio-3-0-execution-failed-for-task-unable-to-merge-dex) – ADM Mar 14 '18 at 10:00

2 Answers2

0

You are implementing the whole play-services package. Try to filter out the dependencies you want to use. For example if you need location api then only compile 'com.google.android.gms:play-services-location:11.8.0'. Try commenting out this line 'com.google.android.gms:play-services:11.6.2'.

AIK
  • 498
  • 2
  • 6
  • 20
0

As your .gradle file suggests, you are explicitly adding the play services in your project and you are also adding firebase DB and appcompat library which is using a different version of the play services. Try to get the version which uses the same play services version.

If you do not know how to do it you can refer to the following command

./gradlew app:dependencies

If you want an in-depth answer please refer to this awesome thread full of the information.

Following is the good article on the conflict of Gradle dependencies.

Chintan Desai
  • 2,607
  • 2
  • 22
  • 25