Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node_modules/react-native/react.gradle' as it does not exist

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where: Build file '/Users/milanshrestha/Documents/work/hermes/mobile/HermesMobileV2/hermesmobile/android/app/build.gradle' line: 86

  • What went wrong: A problem occurred evaluating project ':app'.

Could not read script '/Users/milanshrestha/Documents/work/hermes/mobile/HermesMobileV2/hermesmobile/node_modules/react-native/react.gradle' as it does not exist.

  • 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. ==============================================================================

2: Task failed with an exception.

  • What went wrong: A problem occurred configuring project ':app'.

compileSdkVersion is not specified. Please add it to build.gradle

  • 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 3s

I am facing this issue while running android app i got this issue after upgrading some libs on my project in ios its working fine after some fixes but i got stuck in this. Also after trying all solution from stack overflow questions.

Can anyone help me on this.

like image 485
Milan837 Avatar asked Jun 28 '26 18:06

Milan837


1 Answers

follow this:

https://github.com/facebook/react-native/issues/36643#issuecomment-1685371108

Then in android > app > build.gradle: comment-out/delete the line

apply from: "../../node_modules/react-native/react.gradle" 

if it exists

then run cd android && ./gradlew clean

like image 53
shant1010 Avatar answered Jul 01 '26 20:07

shant1010



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!