I have tried the existing solutions in SO but nothing works.. Any guess where I am wrong. I just updated the gradle in gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
and here is my android/build.gradle
wrapper {
gradleVersion = '5.1.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
My android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
googlePlayServicesVersion = "+"
}
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
googlePlayServicesVersion = "15.0.1"
googlePlayServicesAuthVersion = "15.0.1"
firebaseVersion = "16.0.4"
}
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
// classpath 'com.android.tools.build:gradle:3.1.2' // <--- use this version or newer
classpath 'com.google.gms:google-services:4.2.0' // <--- use this version or newer
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
}
}
subprojects {
project.configurations.all {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
}
wrapper {
gradleVersion = '5.1.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
configurations.all {
resolutionStrategy {
force 'com.google.android.gms:play-services-gcm:12.0.1'
}
}
Android studio gradle file sync
Here I attached through gist since we have character limitation in posting directly.