I am developing a React Native project and am using a third party library react-native-geolocation-service. Inside the build.gradle file of that library, the version of play-services-location is defined as so: (refer to this link for the entire build.gradle file)
dependencies {
def googlePlayServicesVersion = rootProject.hasProperty('googlePlayServicesVersion') ? rootProject.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
implementation "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
}
Inside the build.gradle file of my project, I have the following:
buildscript {
ext {
...
googlePlayServicesVersion = "16.1.0"
}
}
Inside the app/build.gradle file of my project:
dependencies {
implementation(project(':react-native-geolocation-service')) {
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
implementation ('com.google.android.gms:play-services-location:16.0.0') {
force = true
}
}
Even though I have specified in the gradle file to use version 16.0.0 for play-services-location, I still get the following error after I ran gradlew clean
then gradlew build
:
Execution failed for task ':react-native-geolocation-service:generateDebugRFile'.
Could not resolve all files for configuration ':react-native-geolocation-service:debugRuntimeClasspath'.
Could not find com.google.android.gms:play-services-location:16.1.0.
Why is gradle still looking for version 16.1.0 and not version 16.0.0?