Skip to content
Advertisement

react-native app error when try and test in emulator(?)

I get this error below whenever I try to test the app after typing the command npx react-native run-android. I tried setting paths in environmental variables. But still doesn’t work I tried reinstalling react-native but still does not work. I tried to reinstall JDK from java but finally, the app still does not run in the emulator. Any feedback is appreciated 🙂

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:react-native-community_masked-view:compileDebugJavaWithJavac’.

Could not find tools.jar. Please check that C:Program FilesJavajre1.8.0_271 contains a valid JDK installation.

  • Try: Run with –stack trace 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 21s

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

PS C:vibenote-texting

Advertisement

Answer

I think you need to update your PATH variables.

JavaScript

From the docs here

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement