React Native Android Build Fails After Cloning Repository, Despite Passing npx react-native doctor

I recently cloned a React Native project repository, and I’m encountering an issue when trying to run the app on an Android device/emulator. After cloning the repository, I ran the necessary installation steps and confirmed that my development environment is set up correctly, but when I attempt to run the app using npm run android, I encounter the following error:

Steps to Reproduce:

  1. Clone the repository: git clone <repo_url>
  2. Navigate to the project directory.
  3. Run npm install to install dependencies.
  4. Run npm run android.

Output when running npm run android:

> [email protected] android
> react-native run-android

info A dev server is already running for this project on port 8081.
info Installing the app...

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor.

:ReactNative:Running '[node, D:CodeINTERNNCoRidercorider-hybrid-applicationnode_modules@react-native-communityclibuildbin.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'D:CodeINTERNNCoRidercorider-hybrid-applicationnode_modules@react-native-communitycli-platform-androidnative_modules.gradle' line: 401

* What went wrong:
A problem occurred evaluating script.
> Process 'command 'node'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Running '[node, D:CodeINTERNNCoRidercorider-hybrid-applicationnode_modules@react-native-communityclibuildbin.js, config]' command failed. FAILURE: Build failed with an exception. * Where: Script 'D:CodeINTERNNCoRidercorider-hybrid-applicationnode_modules@react-native-communitycli-platform-androidnative_modules.gradle' line: 401 * What went wrong: A problem occurred evaluating script. > Process 'command 'node'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 1s.
info Run CLI with --verbose flag for more details.

Troubleshooting Steps Taken:

  1. I ran npx react-native doctor to verify the setup, and the output shows everything is configured correctly:

    Common
     ✓ Node.js - Required to execute JavaScript code
     ✓ npm - Required to install NPM dependencies
     ✓ Metro - Required for bundling the JavaScript code
    
    Android
     ✓ Adb - Required to verify if the android device is attached correctly
     ✓ JDK - Required to compile Java code
     ✓ Android Studio - Required for building and installing your app on Android
     ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
     ✓ Gradlew - Build tool required for Android builds
     ✓ Android SDK - Required for building and installing your app on Android
    
    Errors:   0
    Warnings: 0
    
  2. I tried running the build with --stacktrace, --info, and --verbose flags, but the issue persists with no additional insight.

Additional Information:

  • React Native version: 0.74.5 (from package.json)
  • React version: 18.2.0
  • Node.js version: 18.x.x
  • npm version: 10.8.2
  • OS: Windows 11
  • Android Studio: Installed and configured correctly, with SDKs and Emulators available.

What I’ve Tried:

  • I confirmed that node and npm are installed and working correctly.
  • I deleted node_modules and ran npm install again.
  • I’ve tried cleaning the Gradle build cache using gradlew clean but still facing the same issue.

What Should I Do Next?

Any help on resolving this issue would be appreciated. Is there any specific configuration or missing setup I need to check? I’m also curious if there are any known issues related to this native_modules.gradle file for this version of React Native.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật