mauron85 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
1.33k stars 561 forks source link

Conflicting versions of Google Play Services with another library #492

Closed davepaiva closed 4 years ago

davepaiva commented 4 years ago

Your Environment

Context

App crashes on startup in while in debug mode, after installing react-native google sign-in from react-community. Cannot use it along with react-native google sign-in. After debugging it for some time, I found out that it was due to conflicting versions in Google Play Services as described in this medium article

Expected Behavior

No crash

Actual Behavior

App crash after build using npx react-native run-android after installing react-native google signin

Possible Fix

A way to change to a compatible Google Play Services Version

Steps to Reproduce

  1. Install this library 2.Install the google signin library 3.run npx react-native run-android 4.App crashes

Thanks in advance

davepaiva commented 4 years ago

Figured it out, just had to modify android/build.gradle as stated in the Dependencies section in the docs. Finally my ext looked like :

    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "27.1.1"
        googlePlayServicesAuthVersion = "17.0.0" // <--- use this version or newer
        googlePlayServicesVersion = "17.0.0"
    }

The issue was that react native google-signin required Play Services Version 16 or higher while I think this library default was 11 or higher