Skip to content
Latchkey

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 :app

Common 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

  1. Run npm ci or yarn install so node_modules is present.
  2. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →