11

Since this morning I cannot build my Android app because I get this error

What went wrong: Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'. com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/measurement/zzabn;

I have tried bumping the Firebase versions accordingly to 15.0.2 but then I get an other error...

Task :app:processDebugGoogleServices Found com.google.android.gms:play-services-maps:15.0.0, but version 15.0.2 is needed for the google-services plugin.

com.google.android.gms:play-services-maps:15.0.2 is not even released yet?

I have a build to push to production, what is the best way to build the app?

Mahdi Bashirpour
  • 17,147
  • 12
  • 117
  • 144
Alexis
  • 1,825
  • 4
  • 23
  • 28
  • `"Firebase Android SDKs now have independent version numbers, allowing for more frequent, flexible updates."` See [Multiple dex files define](https://github.com/geektimecoil/react-native-onesignal/issues/20) – Jon Goodwin May 04 '18 at 20:49
  • I have updated the version accordingly to 15.0.2 (except -ads which is still 15.0.0) but the build still breaks because the google plugin is looking for google-maps 15.0.2 which is not yet released – Alexis May 04 '18 at 20:51
  • check this: https://stackoverflow.com/questions/50149266/compilation-failed-to-completeprogram-type-already-present-com-google-android/50149536#50149536 – Peter Haddad May 04 '18 at 21:07
  • @PeterHaddad bingo updating this classpath 'com.google.gms:google-services:3.3.0' works – Alexis May 04 '18 at 21:11

2 Answers2

13

Please update the google-service plugin to:

classpath 'com.google.gms:google-services:3.3.0'

to be able to use the latest version of Firebase and to avoid the errors.

Read the following for more information:

https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html

Compilation failed to complete:Program type already present: com.google.android.gms.internal.measurement.zzabn

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
0

(Posted solution on behalf of the question author).

Removing com.google.gms.google-services at the bottom of my build.build makes it work.

halfer
  • 19,824
  • 17
  • 99
  • 186