react-native-sdk
react-native-sdk copied to clipboard
Android build fails due to jcenter dependencies
We're experiencing the following error when trying to build our Android app. We already made sure that our build.gradle
and our app/build.gradle
match the ones in the docs (https://github.com/onfido/react-native-sdk#42-update-your-android-buildgradle-files).
Is anyone else experiencing this issue or does anyone have any ideas? Please help. Our team is currently blocked by this issue.
Error
> Task :app:lintVitalRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':onfido_react-native-sdk:releaseRuntimeClasspath'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :onfido_react-native-sdk
> 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'.
> Read timed out
build.gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
androidXBrowser = "1.3.0"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:4.2.2')
classpath('com.google.gms:google-services:4.3.10')
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
url("$rootDir/../node_modules/react-native/android")
}
maven {
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
maven {
url "$rootDir/../node_modules/expo-camera/android/maven"
}
}
}
app/build.gradle
[...]
android {
defaultConfig {
multiDexEnabled true
}
[...]
}
[...]
Versions
@onfido/[email protected]
[email protected]
** EDIT **
I'm getting this error when trying to build an APK:
$ ./gradlew assembleRelease