由于 Java 安装,我无法运行我的 react-native 项目

吉欣议员

//// 我在环境变量中设置了 jdk 路径。但是无法安装该应用程序。我已经尝试了很多次。但是bug还在,如果有解决方法请回复。

     D:\React Project\MyApp>react-native run-android
     info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no- 
     jetifier" 
     flag.
     Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
     info Starting JS server...
     info Installing the app...

     ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_66\bin

     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-starte
     d.html#android-development-environment. Run CLI with --verbose flag for more details.
     Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
     at checkExecSyncError (child_process.js:621:11)
     at execFileSync (child_process.js:639:15)
     at runOnAllDevices (D:\React Project\MyApp\node_modules\@react-native-community\cli-platform- 
     android\build\commands\runAndroid\runOnAllDevices.js:94:39
     )
     at buildAndRun (D:\React Project\MyApp\node_modules\@react-native-community\cli-platform- 
     android\build\commands\runAndroid\index.js:158:41)
     at D:\React Project\MyApp\node_modules\@react-native-community\cli-platform- 
     android\build\commands\runAndroid\index.js:125:12
     at processTicksAndRejections (internal/process/task_queues.js:93:5)
     at async Command.handleAction (D:\React Project\MyApp\node_modules\react- 
     native\node_modules\@react- 
     native-community\cli\build\index.js:164:9)

///

阿卡什·萨卡

像这样设置你的 JAVA_HOME:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_66

/bin 不需要。

查看答案以获取更多参考。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

由于Java版本10,无法运行React Native项目

由于react-native-gesture-handler,无法运行react本机项目

安装Xcode 7后,由于无法打开文档,我无法再构建和运行项目

安装React-Native-firebase后无法运行项目

为什么我无法在我的react-native项目中使用npm安装native-base?

由于升级到Xcode 10.2,我无法再通过cli运行react-native run-ios

由于Windows上的Django安装,我无法创建项目

为什么我不能运行 React Native 项目(转换错误)

React Native - 我的记忆项目被重新渲染

我可以在我的博览会项目中运行 react-native 链接吗?

React Native-run-ios-React Packager进程由于认为我正在运行io.js版本1.6.2而失败

由于react-native中的设计,DatePickerIOS无法正常工作

React Native:由于内存泄漏而无法执行更新

重命名项目后,我的 React Native 项目无法构建

CDN:运行“ pod安装”时,某些URL无法在某些React Native项目中下载?

由于以下错误,我无法同步我的项目

react-native无法打开EXPO项目

无法在React Native项目中扩展Zip

无法创建新的React Native项目

无法删除React Native FlatList中的项目

React Native:React-Native 0.65.1 中的 RNUILib 5.30.0 由于错误而无法构建

当我在项目应用程序中安装并链接 react-native-admob 在加载时崩溃

无法在 android 上运行 react-native 新项目

无法为react-native项目运行npm start

无法运行React-Native UIExplorer示例项目

React Native运行错误:“无法构建iOS项目。我们运行了“ xcodebuild”命令,但它退出,错误代码为65”

我如何将 React Native 模板转换为项目并运行它?

我安装 react-native 并首次运行时出错

如何从我的react-native项目构建android apk?