在使用 cmd 的 react-native run-android 命令中发生错误


Scanning folders for symlinks in F:PROJECTSReactNativealbumsnode_modules (246ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

ERROR: JAVA_HOME is set to an invalid directory:  C:Program FilesJavajdk1.8.0_144
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

任何人都可以在我运行"react-native run-android"命令后分辨出问题所在。

该问题的解决方案是在cmd中键入以下命令:

set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144

相关内容

  • 没有找到相关文章

最新更新