react-native: Android build fails in 0.71.0-rc.0 with "Could not find com.facebook.react:react-native:0.71.0-rc.0"
Description
I’m trying to test the new release candidate.
I’ve created a new app, but when trying to start the app on Android, I get the following error (output of yarn android --variant=release
yields more info:
* What went wrong:
Could not determine the dependencies of task ':app:mergeDexRelease'.
> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
> Could not find com.facebook.react:react-native:0.71.0-rc.0.
Searched in the following locations:
- file:/Users/me/RN0710RC0/node_modules/react-native/android/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0.pom
- file:/Users/me/RN0710RC0/node_modules/jsc-android/dist/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0.pom
- 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://dl.google.com/dl/android/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/0.71.0-rc.0/react-native-0.71.0-rc.0.pom
- https://oss.sonatype.org/content/repositories/snapshots/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0.pom
Required by:
project :app
> Could not find com.facebook.react:hermes-engine:0.71.0-rc.0.
Searched in the following locations:
- file:/Users/me/RN0710RC0/node_modules/react-native/android/com/facebook/react/hermes-engine/0.71.0-rc.0/hermes-engine-0.71.0-rc.0.pom
- file:/Users/me/RN0710RC0/node_modules/jsc-android/dist/com/facebook/react/hermes-engine/0.71.0-rc.0/hermes-engine-0.71.0-rc.0.pom
- https://repo.maven.apache.org/maven2/com/facebook/react/hermes-engine/0.71.0-rc.0/hermes-engine-0.71.0-rc.0.pom
- https://dl.google.com/dl/android/maven2/com/facebook/react/hermes-engine/0.71.0-rc.0/hermes-engine-0.71.0-rc.0.pom
- https://www.jitpack.io/com/facebook/react/hermes-engine/0.71.0-rc.0/hermes-engine-0.71.0-rc.0.pom
- https://oss.sonatype.org/content/repositories/snapshots/com/facebook/react/hermes-engine/0.71.0-rc.0/hermes-engine-0.71.0-rc.0.pom
Required by:
project :app
Also on https://repo.maven.apache.org/maven2/com/facebook/react/react-native/, I see “0.71.0-rc.0” but clicking on it returns a 404.
Is there something I am missing to be able to test the new release candidate?
Version
0.71.0-rc.0
Output of npx react-native info
System:
OS: macOS 12.6.1
CPU: (10) arm64 Apple M1 Max
Memory: 26.56 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.11.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - ~/.npm-global/bin/yarn
npm: 8.19.2 - /opt/homebrew/bin/npm
Watchman: 2022.10.24.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: 11.0.16.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.0-rc.0 => 0.71.0-rc.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
npx react-native init RN0710RC0 --version 0.71.0-rc.0
cd RN0710RC0
yarn android
Snack, code example, screenshot, or link to a repository
I put the result of a newly created project here: https://github.com/louiszawadzki/RN0710RC0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (9 by maintainers)
One last thing about libraries, when I add react-native libraries that have the line
in their
build.gradle
(like https://github.com/DataDog/dd-sdk-reactnative I’m working on), I get the following error when building for Android:Is it something due to the use of the
maven-local
or is it supposed to be fixed in a next 0.71 RC?Tell me if you think this needs a new issue, I can open it 😃
Hey Guys,
i think im experiencing and error that is also related to this, but on RN 0.65.3 - so the latest patch for 0.65
Could not find any matches for com.facebook.react:hermes-engine:0.65.+ as no versions of com.facebook.react:hermes-engine are available.
It seems like there is no hermes version vailabel for this RN Version from my perspective? Would be super happy if someone could help out with that
Hi @cipolleschi @kelset, thanks for your quick help!
I think you need to update the links to
maven-local.zip
in both release and discussion - it links to https://github.com/facebook/react-native/blob/v0.71.0-rc.0 which shows a 404 to me. However there is a link at the bottom of the release (https://github.com/facebook/react-native/releases/download/v0.71.0-rc.0/maven-local.zip) which works 😉After that I was able to start my app with the steps you provided 😃
Feel free to close this issue once the links are updated
A few hours after I posted a question here I found this useful thread (react-native-mmkv/issues/500) where I understood that the solution was downgrading mmkv library to version 2.5 because 2.6+ works for react native version 0.71+
Thanks anyway for your help fencer!
Thanks for flagging this @varemenos. As @kelset mentioned, we’re looking into those kind of issues right now. They’ll be fixed in RC3
@varemenos libraries will need to adapt to some of the changes coming with 0.71, we’re having direct conversations with some key maintainers to setup a migration story for everyone to use, we hope to have it ready ~RC3
I just upgraded to RC1 and tried to run an android app I’m developing locally. One of the dependencies it has is the community async storage (
@react-native-async-storage/async-storage
), does the library need to adapt to the new changes or was RC1 supposed to fix the issue for the libs too?I assume this is related because it can’t match
com.facebook.react:react-native:+
but I’m not 100% sure.Just a heads up that we released 0.71.0-rc1 which should work fine, without having to specify any workaround or download any artifacts manually
yeah it’s expected because you’ll have to move away from that dep; read more of the state of libraries here: https://github.com/reactwg/react-native-releases/discussions/41
Once Nicola is back we’ll figure out the migration path for libraries
yeah so the reason is that we got SonarType to remove (less than 24hrs ago) the 0.71 artifacts from Maven Central, to avoid any further issues and bring back the situation as it was before for the ecosystem. We are writing up now how to test Android for 0.71 RC0 now that the maven artifacts for it don’t exist anymore on maven central, we’ll post those instructions both in the https://github.com/reactwg/react-native-releases/discussions/41 and in the release notes https://github.com/facebook/react-native/releases/tag/v0.71.0-rc.0
( cc @cipolleschi )