0

PS C:\D-drive\MyLearning\FontEnd Learning\ReactNativeCLI\AwesomeProject> npx react-native doctor>> 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

  • Versions found: N/A
  • Version supported: 35.0.0

Errors: 1 Warnings: 0
Attempting to fix 1 issue...
Android
✔ Android SDK configured. You might need to restart your PC for all changes to take effect.

PS C:\D-drive\MyLearning\FontEnLearning\ReactNativeCLI\AwesomeProject>

I fixed the error, but it isn't fixing what I have to do

PS C:\D-drive\MyLearning\FontEnLearning\ReactNativeCLI\AwesomeProject npx 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. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor



FAILURE: Build failed with an exception.
* Where:
Settings file 'C:\D-drive\MyLearning\FontEndLearning\ReactNativeCLI\AwesomeProject\node_modules\@react-native\gradle-plugin\settings.gradle.kts' line: 16
* What went wrong:
An exception occurred applying plugin request [id: 'org.gradle.toolchains.foojay-resolver-convention', version: '0.5.0']
> Failed to apply plugin class 'org.gradle.toolchains.foojay.FoojayToolchainsPlugin'. > FoojayToolchainsPlugin needs Gradle version 7.6 or higher
* 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.

BUILD FAILED in 1s error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where: Settings file 'C:\D-drive\MyLearning\FontEnd Learning\ReactNativeCLI\AwesomeProject\node_modules@react-native\gradle-plugin\settings.gradle.kts' line: 16 * What went wrong: An exception occurred applying plugin request [id: 'org.gradle.toolchains.foojay-resolver-convention', version: '0.5.0'] > Failed to apply plugin class 'org.gradle.toolchains.foojay.FoojayToolchainsPlugin'. > FoojayToolchainsPlugin needs Gradle version 7.6 or higher * 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.

Even though I have all the environment variables set correctly, my project is not starting even if I am trying to start it. What is the solution?

1 Answer 1

0

Inside your Project>android create a local.properties file, And add the below code

sdk.dir = C:\\Users\\{yourUsername}\\AppData\\Local\\Android\\Sdk

Change the yourUsername with your PC username

Again run the below cmd

npm i to again install packages

npx react-native doctor to fix the errors

Press e to fix the errors and start your server again by below cmd

npx react-native run-android

Sign up to request clarification or add additional context in comments.

1 Comment

it doesn't work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.