我已经一步一步地跟随官方 开始。我从一个干净的 Linux 安装开始,并按照“使用本机代码构建项目”选项卡安装了所需的所有东西。我还阅读了故障排除部分。我已经用终端创建了这个项目。
这是我运行 react-native run-android
时出现的错误:
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
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.
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
它没有找到 JAVA _ HOME,因为最新版本的 Android Studio 不需要在系统中安装 JAVA。而是使用内部 JRE。
重复免责声明 : 我已经阅读了 这个问题。这不是我想要的。我知道怎么把爪哇语带回家。我只是想运行反应项目,而不需要安装单独的 Java。
问题:
android
文件夹中打开并运行该项目?在修改父文件夹中的 React JavaScript 代码后,如何刷新该项目?