Unable to load Maven meta-data from https://jcenter.bintray.com/org/webkit/android-jsc/maven-metadata.xml Issue in react native
Make sure that you are using mavenCentral
repository instead of jcenter
https://mvnrepository.com/artifact/org.webkit/android-jsc
Turn off your wifi and then build again.
JCenter is going to shutdown and now READ ONLY. And it is getting offline sometimes causing issues with builds.
First of all, you need to update your build.gradle file to use mavenCentral()
replacing Jcenter()
In case is a library (e.g node_modules/react-native-appsflyer), pointing to Jcenter, that is giving you an error... I would advise you to check the library giving you an error has updated a new version with a fix. In case so, update to the new version to get the changes.
In case no, if you are building in React-native using npm packages, you could potentially take advantage of patch-package library.
Sometimes, the libraries have not yet released the update removing JCenter from build.gradle.
In this case, you can apply the changes yourself using the Patch Package library. Documentation added in the end for reference.
- Go to
node_modules/library-with-error/android/build.gradle
- Change
jcenter()
tomavenCentral()
- Run:
npx patch-package library-with-error
- Git add, commit and push
Important: In case of dependencies (pom, jar) are not added to Maven, here are instructions on how to add: https://maven.apache.org/repository/guide-central-repository-upload.html. Add that to the PR with discussions to collaborate.
Notes:
- I did advise the full removal of
JCenter
instead of adding MavenCentral() to the top because of the shutdown: "Based on the current timeline, builds that use JCenter will be able to resolve dependencies until February 1, 2022 without changes. After that date, there are no guarantees that you will be able to build your software if you continue to use JCenter." - Add
--use-yarn
topatch-package
command in case your project uses Yarn. - Documentation using Patch package.