Hey folks, I'm trying to build a React Native app ...
# caching
r
Hey folks, I'm trying to build a React Native app using
./gradlew assembleDebug
, but I keep running into a Gradle failure related to dependency resolution. The error occurs during the
:app:checkDebugAarMetadata
task and says that it can’t find any version of
com.facebook.react:react-native
. Here’s the relevant part of the logs:
Copy code
> Task :app:checkDebugAarMetadata FAILED

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available.      
     Searched in the following locations:
       - 
<https://dl.google.com/dl/android/maven2/com/facebook/react/react-native/maven-metadata.xml>
       - <https://repo.maven.apache.org/maven2/com/facebook/react/react-native/maven-metadata.xml>
       - <https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0.pom>
       - <https://www.jitpack.io/com/facebook/react/react-native/maven-metadata.xml>
       - <https://maven.google.com/com/facebook/react/react-native/maven-metadata.xml>
       - file:/path/to/node_modules/react-native/android/com/facebook/react/react-native/maven-metadata.xml
       - file:/path/to/node_modules/jsc-android/dist/com/facebook/react/react-native/maven-metadata.xml
Has anyone faced this before? I'm wondering if this might be related to using
+
in the dependency version or a missing local Maven repo. Appreciate any suggestions! 🙏
t
There's something strange with this dependency: version 0.71.0-rc.0 has apparently been published (3 years ago though, the project has been renamed to react-android since then) and is listed in the maven-metadata.xml, and the directory is listed in the parent directory (https://repo.maven.apache.org/maven2/com/facebook/react/react-native/), but accessing it or its POM or JAR results in a 404 Not Found. So, yes, this is in part due to using
+
, along with a borked repository (you may want to report that to Sonatype). But given that this project has been relocated to new coordinates, you'd better update your project to that rather than, say, using the previous react-native version from 9 years ago!
v
Isn't that dependency anyway not coming from an online repository, but from an NPM dependency as local repository or something like that? Afair the react native Gradle plugin should define the version, so you should probably not have any version at all, also not
+
, but have the according react native Gradle plugin version?
Besides that, none of the question is related to caching, so the question is off-topic here. ;-)