[英]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.每当我在输入命令 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.
但仍然不起作用我尝试重新安装 react-native 但仍然不起作用。 I tried to reinstall JDK from java but finally, the app still does not run in the emulator.
我尝试从 java 重新安装 JDK,但最后,该应用程序仍然无法在模拟器中运行。 Any feedback is appreciated:)
任何反馈表示赞赏:)
FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。
Could not find tools.jar.
找不到工具。jar。 Please check that C:\Program Files\Java\jre1.8.0_271 contains a valid JDK installation.
请检查 C:\Program Files\Java\jre1.8.0_271 是否包含有效的 JDK 安装。
Try: Run with --stack trace option to get the stack trace.尝试:使用 --stack trace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.
运行 --scan 以获得完整的见解。
Get more help at https://help.gradle.org在https://help.gradle.org获得更多帮助
BUILD FAILED in 21s 21 秒内构建失败
error Failed to install the app.错误 无法安装应用程序。 Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup .
确保您已设置 Android 开发环境: https://reactnative.dev/docs/environment-setup 。 Run CLI with --verbose flag for more details.
使用 --verbose 标志运行 CLI 以获取更多详细信息。 Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
PS C:\vibenote-texting PS C:\vibenote-texting
I think you need to update your PATH variables.我认为您需要更新 PATH 变量。
To set the PATH variable permanently, add the full path of the jdk1.7.0\bin directory to the PATH variable. Typically, this full path looks something like C:\Program Files\Java\jdk1.7.0\bin. Set the PATH variable as follows on Microsoft Windows:
Click Start, then Control Panel, then System.
Click Advanced, then Environment Variables.
Add the location of the bin folder of the JDK installation for the PATH variable in System Variables. The following is a typical value for the PATH variable:
C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.7.0\bin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.