【发布时间】:2020-01-11 10:30:47
【问题描述】:
使用react-native init AwesomeProject 初始化我的项目后,我尝试通过react-native run-android 在模拟器中运行它
但是我收到以下错误:
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
但是我遵循Getting Started Guide 并设置了 JAVA_HOME 环境变量,C:\Program Files\Java\jdk1.8.0_221\bin 也在路径变量中。
我正在使用 WSL bash 在 Windows 10 上尝试此操作。
【问题讨论】:
标签: react-native react-native-android