I'm new to React Native and I'm having trouble getting started with my first project. I've followed the installation steps for React Native, including setting up Java, Android Studio, and the related SDK files. I've also configured the necessary environment variables for Android as shown in the attached images.
Despite following all the installation steps, I'm encountering an issue when trying to initialize a new React Native project. It's not working as expected, I'm encountering an issue while setting up a React Native project. When I run npx react-native doctor, I receive the following error message:
Error:
error Failed to install the app.
PS D:\Visual Studio Code\Projects\React Native\AwesomeProject> npx react-native doctor
Common
✓ Node.js - Required to execute JavaScript code
✓ yarn - Required to install NPM dependencies
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 SDK - Required for building and installing your app on Android
- Versions found: N/A
- Version supported: 33.0.0
✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
Errors: 1
Warnings: 0
Usage
› Press f to try to fix issues.
› Press e to try to fix errors.
› Press w to try to fix warnings.
› Press Enter to exit.
It appears that the Android SDK is not being detected, even though I have Android Studio installed. Here are the steps I've taken to resolve the issue:
- Installed Android Studio and confirmed that it includes the Android SDK.
- Set the
ANDROID_HOMEenvironment variable to the correct path. - Added the
platform-toolssubdirectory of the Android SDK to my system's PATH variable. - Checked and confirmed that the Android SDK components corresponding to version 33.0.0 are installed using the SDK Manager in Android Studio.
Despite these steps, I'm still encountering the error. Can someone please help me troubleshoot and resolve this issue? Any guidance or insights would be greatly appreciated.
Operating System: Windows Android Studio Version: 2022.3.1.19 React Native Version: 0.72.4
I want a relevant solution to resolve this issue





try this:
cd androidchmod +x gradlew./gradlew cleanthen run your app