Skip to content

Problem with android/settings.gradle #2654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rodrigotoledo opened this issue Apr 28, 2025 · 2 comments
Open

Problem with android/settings.gradle #2654

rodrigotoledo opened this issue Apr 28, 2025 · 2 comments

Comments

@rodrigotoledo
Copy link

Environment

npx react-native doctor passes without errors.

React Native: 0.79.1
Node: 18+
NPM: 9+

Description

I am using the latest version of React Native (0.79.1) and trying to run the project with the latest stable version of @react-native-community/cli.

However, the installed package does not include the expected file:
cli-platform-android/native_modules.gradle.

As a result, the build fails when android/settings.gradle tries to execute:

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings);

To temporarily fix the issue, I had to manually comment out these lines in android/settings.gradle:

// apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
// applyNativeModulesSettingsGradle(settings);

This behavior is unexpected, considering I am using the latest compatible stable versions.

Reproducible Demo

  • Create a new React Native 0.79.1 project.

  • Install @react-native-community/cli@latest.

  • Run npx react-native run-android.

  • Build fails due to missing native_modules.gradle.

  • Comment out the lines in android/settings.gradle to bypass the error.

@cainlevy
Copy link

I'm also experiencing this with:

  • react-native@0.76.9
  • @react-native-community/cli@18.0.0
  • node@22.15.0

@cainlevy
Copy link

cainlevy commented May 29, 2025

The expected native_modules.gradle file appears to be nothing more than a log warning to upgrade to React Native Gradle Plugin. I'm not sure why this settings.gradle line exists in the project I've inherited, but it seems skippable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants