React Native "Could not find com.facebook.react:react-native" in CI
The Android build cannot find the react-native artifact. Recent React Native ships the Android library from node_modules, so a missing install or repo config breaks resolution.
What this error means
The Gradle build fails with Could not find com.facebook.react:react-native:X. It happens when node_modules is absent or the maven repo for it is not configured.
react-native
Could not find com.facebook.react:react-native:0.74.0.
Required by:
project :appCommon causes
node_modules not installed before the Android build
React Native serves its Android artifact from node_modules; without npm/yarn install it cannot be found.
Maven repo not declared
The repository that hosts the React Native Android artifact is missing from the build config.
How to fix it
Install JS dependencies before Gradle
- Run npm ci or yarn install so node_modules is present.
- Then run the Gradle build from the android directory.
shell
npm ci
(cd android && ./gradlew assembleRelease)Confirm the repositories include node_modules
Ensure the Android build declares the maven repo pointing at node_modules/react-native/android as React Native expects.
How to prevent it
- Always install JS dependencies before the native Android build and cache node_modules keyed on the lockfile. Android builds run on Linux runners.
Related guides
React Native "Execution failed for task :app:installDebug" in CIFix the React Native "Execution failed for task :app:installDebug" error in CI by building (assemble) instead…
React Native "bundling failed" (Metro) in CIFix the React Native "error: bundling failed" Metro error in CI by resolving the unresolved import, missing a…
Android "Could not find google() repository" in CIFix Android "could not find" errors for Google-hosted artifacts in CI by adding the google() repository to de…