How to solve Google Play Services version collision in gradle dependencies

Today I spent whole day debugging my Android build process in React Native. When I build app, everytime when I used react-native-maps component, my app crashed. After few minutes of googling, I found this issue is related to version Google Play Services ( that collide between react-native-maps and react-native-fcm.

I tried few simple fixes from few guides. I changed my android/app/build.gradle from this:

My origin dependencies

To this:

As you can see, I am excluded react-native-maps internal package dependecies on Google Play Services ( and force of use same version as (Firebase is part Google Play Services so you need same version too !important). I run my build, but it failed with this error:

Failed on android with Multiple dex files define Lcom/google/android/gms/internal/zzpq

Or after few small changes I got this:

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at or updating the version of to 9.8.0.

It wasn't able to find solution whole day


I was trapped between these two errors whole day. But I finally found the solution and created universal guide how to solve this problem. You need to search over your native dependecies in node_modules for their build.gradle and in this files look for dependecies starting with or After that you need to exclude these internal dependecies and force use of same version everywhere.

In my case it was modules react-native-fcm, react-native-maps, react-native-device-info and this is how their build.gradle look:


As you can see, react-native-maps has dependency on of version 9.8.0. React-native-fcm has dependency on of version + (in simple, + means latest available version) and react-native-device-info has dependency on latest version of

So I excluded all these internal dependencies and force of use of the same version. This is my final android/app/build.gradle:

Don't forget run gradlew clean command before build!!!




Javascript, React, React Native, RxJS, functional programming…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Daniel Suchý

Javascript, React, React Native, RxJS, functional programming…