Skip to content
Latchkey

React Native "Could not determine the dependencies of task" (Android) in CI

Gradle configures a task and finds it depends on outputs that were never produced, so it cannot determine the task graph. In React Native this often traces to autolinking or codegen not running, or a dependency that failed to resolve.

What this error means

The Android build fails with "Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'." (or similar), with a "Caused by" pointing at a missing artifact or configuration.

Gradle
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find com.facebook.react:react-android:.

Common causes

A dependency or autolinking config was not resolved

The React Native Gradle plugin or autolinking did not produce the expected dependency, so the task cannot be configured.

A version mismatch in the React Native Android artifacts

The react-android/hermes-android coordinates do not match the installed react-native version.

How to fix it

Reinstall node modules and clean Gradle

  1. Run a clean npm ci / yarn install --frozen-lockfile so autolinking config is regenerated.
  2. Clean the Android build to drop stale configuration.
  3. Rebuild.
Terminal
npm ci
cd android && ./gradlew clean && ./gradlew assembleDebug --stacktrace

Align React Native Gradle plugin and versions

Ensure the RN Gradle plugin is applied and the react-native version matches the artifacts it pulls.

android/settings.gradle
// android/settings.gradle
includeBuild("../node_modules/@react-native/gradle-plugin")

How to prevent it

  • Run a clean install in CI so autolinking config is fresh.
  • Keep react-native and its Gradle plugin versions in lockstep.
  • Cache Gradle keyed on lockfiles, not across version bumps.

Related guides

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