[英]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 工作过
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.
但是现在我有一个新的错误需要修复,这基本上是应用程序没有检测到设备或仿真。
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.
如果有人知道如何让它自动运行默认虚拟设备,那就太好了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.