[英]react-native app error when try and test in emulator(?)
每當我在輸入命令 npx react-native run-android 后嘗試測試應用程序時,我都會在下面收到此錯誤。 我嘗試在環境變量中設置路徑。 但仍然不起作用我嘗試重新安裝 react-native 但仍然不起作用。 我嘗試從 java 重新安裝 JDK,但最后,該應用程序仍然無法在模擬器中運行。 任何反饋表示贊賞:)
FAILURE:構建失敗並出現異常。
找不到工具。jar。 請檢查 C:\Program Files\Java\jre1.8.0_271 是否包含有效的 JDK 安裝。
嘗試:使用 --stack trace 選項運行以獲取堆棧跟蹤。 使用 --info 或 --debug 選項運行以獲得更多日志 output。 運行 --scan 以獲得完整的見解。
在https://help.gradle.org獲得更多幫助
21 秒內構建失敗
錯誤 無法安裝應用程序。 確保您已設置 Android 開發環境: https://reactnative.dev/docs/environment-setup 。 使用 --verbose 標志運行 CLI 以獲取更多詳細信息。 錯誤:命令失敗:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
PS C:\vibenote-texting
我認為您需要更新 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.