Gradle build not working for React Native project after updating Gradle version and Android Studio
I'd looked through similar questions on here but I haven't found any that worked for me so far.
Problem
I recently updated Android studio to the version below:
Android Studio Arctic Fox | 2020.3.1 Patch 4
Build #AI-203.7717.56.2031.7935034, built on November 21, 2021
Runtime version: 11.0.10+0-b96-7281165 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.0.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 4
Registry: external.system.auto.import.disabled=true
After doing this, I somehow managed to update the Android Gradle Plugin Version
to 4.1.3
and Gradle Version
to 6.9
under File > Project Structure > Project.
After doing this, a Gradle sync was triggered and it was successful but there were these warnings:
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.fresco:fresco:2.0.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.squareup.okhttp3:okhttp:3.12.12.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.yoga:proguard-annotations:1.14.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.flipper:flipper-fresco-plugin:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.flipper:flipper-network-plugin:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.soloader:soloader:0.9.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.squareup.okio:okio:1.17.5.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.fbjni:fbjni-java-only:0.0.3.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.fresco:imagepipeline-okhttp3:2.0.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.device.yearclass:yearclass:2.1.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.soloader:soloader:0.9.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.flipper:flipper:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.fbjni:fbjni-java-only:0.0.3.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.fresco:fresco:2.0.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.squareup.okio:okio:1.17.5.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.infer.annotation:infer-annotation:0.11.2.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.12.12.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.yoga:proguard-annotations:1.14.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.fresco:fresco:2.0.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.flipper:flipper:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.fresco:imagepipeline-okhttp3:2.0.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.squareup.okhttp3:okhttp:3.12.12.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.squareup.okhttp3:okhttp:3.12.12.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.12.12.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.soloader:soloader:0.9.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.fbjni:fbjni-java-only:0.0.3.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.yoga:proguard-annotations:1.14.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.squareup.okio:okio:1.17.5.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.flipper:flipper:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.flipper:flipper-fresco-plugin:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.infer.annotation:infer-annotation:0.11.2.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.facebook.device.yearclass:yearclass:2.1.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.flipper:flipper-network-plugin:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.flipper:flipper-fresco-plugin:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.flipper:flipper-network-plugin:0.75.1.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.facebook.fresco:imagepipeline-okhttp3:2.0.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.12.12.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.infer.annotation:infer-annotation:0.11.2.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.facebook.device.yearclass:yearclass:2.1.0.
Show Details
Affected Modules: app
And when I try to run the app on an emulator, the Gradle build fails with these errors:
> Task :app:validateSigningDebug
FAILURE: Build completed with 18 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.facebook.flipper:flipper:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.flipper:flipper-network-plugin:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.flipper:flipper-fresco-plugin:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :app
project :app > project :unimodules-react-native-adapter
project :app > project :react-native-async-storage_async-storage
project :app > project :react-native-community_clipboard
project :app > project :react-native-masked-view_masked-view
project :app > project :react-native-email-link
project :app > project :react-native-encrypted-storage
project :app > project :react-native-gesture-handler
project :app > project :react-native-pager-view
project :app > project :react-native-safe-area-context
project :app > project :react-native-screens
project :app > project :react-native-svg
project :app > project :react-native-vector-icons
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20.
Required by:
project :app > project :unimodules-core
project :app > project :unimodules-react-native-adapter
project :app > project :expo-constants
project :app > project :expo-haptics
project :app > project :expo-local-authentication
project :app > project :expo-localization
project :app > project :expo-modules-core
project :app > project :unimodules-app-loader
project :app > project :unimodules-task-manager-interface
> Skipped due to earlier error
> Could not resolve com.facebook.device.yearclass:yearclass:2.1.0.
Required by:
project :app > project :expo-constants
> Skipped due to earlier error
> Could not resolve commons-io:commons-io:2.6.
Required by:
project :app > project :expo-constants
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.5.30.
Required by:
project :app > project :react-native-pager-view
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20.
Required by:
project :app > project :react-native-screens
> Skipped due to earlier error
> Could not resolve com.google.crypto.tink:tink-android:1.5.0.
Required by:
project :app > project :react-native-encrypted-storage > androidx.security:security-crypto:1.1.0-alpha03
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.5.30.
Required by:
project :app > project :react-native-screens > androidx.core:core-ktx:1.6.0
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.facebook.flipper:flipper:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.flipper:flipper-network-plugin:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.flipper:flipper-fresco-plugin:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :app
project :app > project :unimodules-react-native-adapter
project :app > project :react-native-async-storage_async-storage
project :app > project :react-native-community_clipboard
project :app > project :react-native-masked-view_masked-view
project :app > project :react-native-email-link
project :app > project :react-native-encrypted-storage
project :app > project :react-native-gesture-handler
project :app > project :react-native-pager-view
project :app > project :react-native-safe-area-context
project :app > project :react-native-screens
project :app > project :react-native-svg
project :app > project :react-native-vector-icons
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20.
Required by:
project :app > project :unimodules-core
project :app > project :unimodules-react-native-adapter
project :app > project :expo-constants
project :app > project :expo-haptics
project :app > project :expo-local-authentication
project :app > project :expo-localization
project :app > project :expo-modules-core
project :app > project :unimodules-app-loader
project :app > project :unimodules-task-manager-interface
> Skipped due to earlier error
> Could not resolve com.facebook.device.yearclass:yearclass:2.1.0.
Required by:
project :app > project :expo-constants
> Skipped due to earlier error
> Could not resolve commons-io:commons-io:2.6.
Required by:
project :app > project :expo-constants
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.5.30.
Required by:
project :app > project :react-native-pager-view
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20.
Required by:
project :app > project :react-native-screens
> Skipped due to earlier error
> Could not resolve com.google.crypto.tink:tink-android:1.5.0.
Required by:
project :app > project :react-native-encrypted-storage > androidx.security:security-crypto:1.1.0-alpha03
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.5.30.
Required by:
project :app > project :react-native-screens > androidx.core:core-ktx:1.6.0
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.facebook.flipper:flipper:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.flipper:flipper-network-plugin:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.flipper:flipper-fresco-plugin:0.75.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :app
project :app > project :unimodules-react-native-adapter
project :app > project :react-native-async-storage_async-storage
project :app > project :react-native-community_clipboard
project :app > project :react-native-masked-view_masked-view
project :app > project :react-native-email-link
project :app > project :react-native-encrypted-storage
project :app > project :react-native-gesture-handler
project :app > project :react-native-pager-view
project :app > project :react-native-safe-area-context
project :app > project :react-native-screens
project :app > project :react-native-svg
project :app > project :react-native-vector-icons
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20.
Required by:
project :app > project :unimodules-core
project :app > project :unimodules-react-native-adapter
project :app > project :expo-constants
project :app > project :expo-haptics
project :app > project :expo-local-authentication
project :app > project :expo-localization
project :app > project :expo-modules-core
project :app > project :unimodules-app-loader
project :app > project :unimodules-task-manager-interface
> Skipped due to earlier error
> Could not resolve com.facebook.device.yearclass:yearclass:2.1.0.
Required by:
project :app > project :expo-constants
> Skipped due to earlier error
> Could not resolve commons-io:commons-io:2.6.
Required by:
project :app > project :expo-constants
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.5.30.
Required by:
project :app > project :react-native-pager-view
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20.
Required by:
project :app > project :react-native-screens
> Skipped due to earlier error
> Could not resolve com.google.crypto.tink:tink-android:1.5.0.
Required by:
project :app > project :react-native-encrypted-storage > androidx.security:security-crypto:1.1.0-alpha03
> Skipped due to earlier error
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.5.30.
Required by:
project :app > project :react-native-screens > androidx.core:core-ktx:1.6.0
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':unimodules-core:generateDebugRFile'.
> Could not resolve all files for configuration ':unimodules-core:debugCompileClasspath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21.
Required by:
project :unimodules-core
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
5: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-async-storage_async-storage:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-async-storage_async-storage:debugCompileClasspath'.
> Could not resolve com.facebook.infer.annotation:infer-annotation:0.11.2.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.facebook.yoga:proguard-annotations:1.14.1.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.facebook.fresco:fresco:2.0.0.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:2.0.0.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.facebook.soloader:soloader:0.9.0.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.squareup.okhttp3:okhttp:3.12.12.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.12.12.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.squareup.okio:okio:1.17.5.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.facebook.fbjni:fbjni-java-only:0.0.3.
Required by:
project :react-native-async-storage_async-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
6: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-community_clipboard:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-community_clipboard:debugCompileClasspath'.
> Could not resolve com.facebook.yoga:proguard-annotations:1.14.1.
Required by:
project :react-native-community_clipboard > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.facebook.fbjni:fbjni-java-only:0.0.3.
Required by:
project :react-native-community_clipboard > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
7: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-email-link:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-email-link:debugCompileClasspath'.
> Could not resolve com.facebook.yoga:proguard-annotations:1.14.1.
Required by:
project :react-native-email-link > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Could not resolve com.facebook.fbjni:fbjni-java-only:0.0.3.
Required by:
project :react-native-email-link > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
8: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-encrypted-storage:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-encrypted-storage:debugCompileClasspath'.
> Could not resolve com.facebook.yoga:proguard-annotations:1.14.1.
Required by:
project :react-native-encrypted-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
> Could not resolve com.facebook.fbjni:fbjni-java-only:0.0.3.
Required by:
project :react-native-encrypted-storage > com.facebook.react:react-native:0.64.1
> Skipped due to earlier error
> Skipped due to earlier error
I couldn't make any sense of the errors myself, I'm thinking that I need to update all the dependencies (react-native packages) that are listed in these Gradle builds?
Here's more information:
-
React Native version:
0.64.1
. -
Root-level
build.gradle
:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "30.0.0"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:4.1.3')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
content of gradle-wrapper.properties
file
#Wed Jan 12 19:07:20 WAT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
content of gradle.properties
file:
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.75.1
Even though its marked deprecated and sunset, jcenter will remain a read depo indefinitely. It could be that your dependency is on bintray or possibly that gradle itself has dropped support. You might need to find an alternative.
https://blog.gradle.org/jcenter-shutdown
UPDATE: JFrog has decided to keep JCenter as a read-only repository indefinitely. New package and versions are no longer accepted on JCenter. All Bintray services have been shutdown.
I followed medium article and moved jcenter()
to the bottom of repositories {}
in .\android\build.gradle
These solved my issue. Hope it works for you. Thanks