I recently started my React Native journey and hit a snag before I could even start to code. I followed the guide by Facebook on how to set up your environment for a React Native project, though I installed java SDK, python and node manually instead of through chocolatey. Installing the react native application on my system went smoothly but when I try to run on my Android Emulator by using the command react-native run-android
, I run into the following Error message.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
The system cannot find the path specified.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
The system cannot find the path specified.
Note: I have not made any changed in any file nor deleted anything
Steps to reproduce
- Run the command
react-native init AwesomeProject
cd AwesomeProject
- Ensure Emulator is running then start Metro Bundler with
react-native start
- Run command
react-native run-android
in a separate terminal to receive error
Steps taken to resolve
I have tried following multiple issues and queries of others with similar problems to no avail
- I tried re-installing everything from scratch to no avail, and creating a new project but the same message appears after hours of re-installation
- One person suggested running
gradle wrapper
inside the project folder, but that too made no difference - Another suggested that a file name
gradle-wapper.jar
would be missing, but its there in the project folder - I tried loading the Android folder of the react native project in my Android Studio, the gradle starts building but there is still no success when the gradle is built
Packages Installed
- Node V12.18.2
- Java SDK V8
- Python 2.7
- Android Studio SDK [Android 10.0 (Q)]
- Android SDK Build-Tools (Installed)
- Android Emulator (Installed)
- Android SDK Platform-Tools (Installed)
- Intel x86 Emulator Accelerator (HAXM Installer) (Installed)
Please let me know if any further information is required to understand my problem. Thanks!