2

After upgrade Google Play Services to 15.0.0 Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

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

Mstack
  • 321
  • 1
  • 12
  • Possible duplicate of [Unable to merge dex](https://stackoverflow.com/questions/46267621/unable-to-merge-dex) and also try to add : `multiDexEnabled true` in build.gradle: https://stackoverflow.com/a/50340286/4409113 – ʍѳђઽ૯ท Sep 05 '18 at 07:49
  • Update your question with play services dependencies on manifest file. – Khaled Lela Sep 05 '18 at 07:52
  • @ʍѳђઽ૯ท `multiDexEnabled true` May be bad idea if he can use only needed play services modules – Khaled Lela Sep 05 '18 at 07:54

2 Answers2

1

I have the same problem, just delete the .gradle file, and then clean your project from Build > Clean Project

you can find .gradle file in project view in the navigator on the top left

enter image description here

If you do not enabled Multidex follow this link: LINK

Hamid Reza
  • 624
  • 7
  • 23
0

You should not include com.google.android.gms:play-services:... as a dependency. This adds ALL the Google Play Services APIs to your build and will probably require you to use MultiDex. Instead, follow the directions provided in the Setup Guid in the section titled Selectively compiling APIs into your executable to add as depencies only the specific APIs that you actually use.

But if you feel to use it, you can simple do the following:

Enable Multidex through build.gradle of your app module

multiDexEnabled true
Not Fix my problem. :(

Try this :

From the Build menu -> press the Clean Project button. When task completed, press the Rebuild Project button from the Build menu.

compile is now deprecated if you are still using it. Use implementation or api

Community
  • 1
  • 1
olajide
  • 972
  • 1
  • 13
  • 26