简体   繁体   English

React Native Android 开发 - Windows Webstorm 上的任务 ':app:compileDebugJavaWithJavac' 执行失败

[英]React Native Android Development - Execution failed for task ':app:compileDebugJavaWithJavac' on Windows Webstorm

I have an issue with installing and running the React-Native Android guide to create AwesomeProject .我在安装和运行 React-Native Android 指南以创建AwesomeProject 时遇到问题 I am using a Windows 10 environment with Webstorm as my IDE.我使用 Windows 10 环境和 Webstorm 作为我的 IDE。 When ever I run the following command, the emulator fails to launch:当我运行以下命令时,模拟器无法启动:

react-native run-android

Here is a screen cap of the Web Storm:这是 Web Storm 的屏幕截图: 在此处输入图片说明

I have all the SDK and JDK configured in my System Environments, this is why I don't the error.我在系统环境中配置了所有 SDK 和 JDK,这就是为什么我没有错误的原因。 Here are the additional steps I took configuring Gradle plugin:以下是我配置 Gradle 插件的额外步骤: 在此处输入图片说明

I have googled the issue but the solutions I found were for MacOS users and didn't translate for Windows.我在谷歌上搜索了这个问题,但我找到的解决方案是针对 MacOS 用户的,并没有针对 Windows 进行翻译。

Has anyone come across this issue on Windows and fixed it?有没有人在 Windows 上遇到过这个问题并修复了它?

I fixed the issue by installing JDK 8 as listed in the React Native guide.我通过安装 React Native 指南中列出的JDK 8解决了这个问题。 Then updated both the Environment Variables and the gradle.properties file.然后更新环境变量和gradle.properties文件。

I ONLY GOT IT TO WORK IN ANDROID STUDIO我只在 ANDROID STUDIO 工作过

环境变量

gradle.properties 文件

This seems to have worked for me.这似乎对我有用。 But now I got a new error to fix, which basically is that application isn't detecting a device or emulation.但是现在我有一个新的错误需要修复,这基本上是应用程序没有检测到设备或仿真。

任务 ':app:installDebug' 执行失败

However, to get around that, I have to ensure that I open the AVD Manager and run one of the configured virtual devices prior to executing the command npx react-native run-android .但是,为了解决这个问题,我必须确保在执行命令npx react-native run-android之前打开 AVD 管理器并运行配置的虚拟设备之一。

This does annoy me having to perform that task first.这让我不得不先执行那个任务让我很恼火。 If anyone knows how to get it to automatically run a default virtual device, that would be nice.如果有人知道如何让它自动运行默认虚拟设备,那就太好了。

成功执行Awesome Project

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 任务':app:compileDebugJavaWithJavac'的执行失败。 适用于Android的React Native应用程序 - Execution failed for task ':app:compileDebugJavaWithJavac'. React Native application for Android 任务 ':app:compileDebugJavaWithJavac' 的 Android 执行失败。 - 反应原生 - Android Execution failed for task ':app:compileDebugJavaWithJavac'. - React Native 任务':app:compileDebugJavaWithJavac'的执行失败反应本机 - Execution failed for task ':app:compileDebugJavaWithJavac' react native React Native-任务':app:compileDebugJavaWithJavac'的执行失败 - React Native - Execution failed for task ':app:compileDebugJavaWithJavac' 任务“:app:compileDebugJavaWithJavac”执行失败。 在运行 React Native 项目时 - Execution failed for task ':app:compileDebugJavaWithJavac'. while running React Native Project React-native 问题 - 任务 ':app:compileDebugJavaWithJavac' 执行失败 - React-native problem - Execution failed for task ':app:compileDebugJavaWithJavac' Android Studio-任务':app:compileDebugJavaWithJavac'的执行失败 - Android Studio - Execution failed for task ':app:compileDebugJavaWithJavac' 任务执行失败:app:compileDebugJavaWithJavac in Android Studio 2 - Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio 2 Android Studio 中任务 :app:compileDebugJavaWithJavac 的执行失败 - Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio android - 任务 ':app:compileDebugJavaWithJavac' 执行失败 - android - Execution failed for task ':app:compileDebugJavaWithJavac'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM