【发布时间】:2020-06-30 08:32:53
【问题描述】:
我对 React native 很陌生,并尝试使用 Visual Studio 设置 Android 环境。所有安装都相当成功,但是,当我尝试在执行npx react-native run-android 命令的 android 模拟器上运行示例应用程序时,它显示以下错误 -
'C:\Users\Home' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
但是,当我在 Visual Studio 上执行 adb devices 时,它会显示已连接的模拟器列表 -
List of devices attached
emulator-5554 device
可能的原因是什么?这是因为我的用户名是 Home PC 吗? (是不是因为中间有空格)无法获取到正确的路径?
【问题讨论】:
标签: react-native android-emulator react-native-android