React-native-firebase: play-services-base Version collision with react-native-maps

Created on 9 Aug 2018  路  10Comments  路  Source: invertase/react-native-firebase

Issue

When installing react-native-firebase with react-native-maps, I'm getting error as follows

The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 10.2.4. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Which is due to the mismatch in the version of 'com.google.android.gms:play-services-base.

In react-native-maps its using
implementation 'com.google.android.gms:play-services-base:10.0.1'

and in react-native-firebase it is using
implementation ("com.google.android.gms:play-services-base:15.0.1")

Here is the snippet of build.gradle file:

dependencies {
    compile project(':react-native-firebase')
    compile project(':react-native-vector-icons')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile project(':react-native-linear-gradient')
    compile "com.facebook.react:react-native:+"  // From node_modules
    implementation(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation 'com.google.android.gms:play-services-base:10.0.1'
    implementation 'com.google.android.gms:play-services-maps:10.0.1'
    // Firebase dependencies
    implementation "com.google.android.gms:play-services-base:15.0.1"
    implementation "com.google.firebase:firebase-core:16.0.1"
}

Environment

  1. Application Target Platform:
    Android

  2. Development Operating System:
    MacOS

  3. React Native version:
    0.56.0)

  4. React Native Firebase Version:
    ^4.3.8

  5. Are you using typescript?
    No

Any help would be appreciated. Thanks.

Build Error Android

Most helpful comment

This is a pain that runs across pretty much every framework (React Native, NativeScript, etc).
Firebase and Google Maps plugins have a hard time playing together.

Try adding this to your project build.grade:
ext { googlePlayServicesVersion = "15.0.1" }

All 10 comments

Any updates of issue? I struggle the same problem...

Have you guys tried the solution here: https://medium.com/@suchydan/how-to-solve-google-play-services-version-collision-in-gradle-dependencies-ef086ae5c75f ?

@Ehesp I did try it but still no help.

This is a pain that runs across pretty much every framework (React Native, NativeScript, etc).
Firebase and Google Maps plugins have a hard time playing together.

Try adding this to your project build.grade:
ext { googlePlayServicesVersion = "15.0.1" }

I am getting the same problem with react native maps and firebase:

_The library com.google.android.gms:play-services-base is being requested by various other libraries at [[10.2.4,10.2.4]], but resolves to 15.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies._

Did anybody have an update?

i am also having the same issue. Did anyone have an update?

@ogmedia , sir, your solution worked but it only helps to make successfull build but when i open the app it crashes.

anyone plz help

@kalraneeraj24550 Make sure you have placed the google-services.json file. Most of the time app crashes in absence of the file.

Also you can check the LOGCAT for crash info to know why the app is crashing.

google-services.json is present in my app

Was this page helpful?
0 / 5 - 0 ratings