简体   繁体   English

react-native>运行android模拟器会导致“无法启动”模拟器错误

[英]react-native > Running android simulator results in “Could not launch” emulator error

I'm trying to run a react-native android simulator using the react-native-run-android library, but I receive the following error: 我正在尝试使用react-native-run-android库运行react-native android模拟器,但是出现以下错误:

Could not launch '/usr/local/bin/../emulator/qemu/darwin-x86_64/qemu-system-i386' 无法启动'/usr/local/bin/../emulator/qemu/darwin-x86_64/qemu-system-i386'

I have the emulator successfully installed, and I can run android from Android Studio > AVD Manager . 我已经成功安装了emulator ,并且可以从Android Studio > AVD Manager运行android。

The library is looking for an /usr/local/emulator folder (but it was installed in another directory). 该库正在寻找/usr/local/emulator文件夹(但它已安装在另一个目录中)。 First I checked whether the directory existed (it didn't), found where the installation directory actually was, then created a symbolic link to the actual folder location. 首先,我检查目录是否存在(不存在),找到安装目录的实际位置,然后创建指向实际文件夹位置的符号链接。 Finally, check the requested directory exists, then everything worked. 最后,检查请求的目录是否存在,然后一切正常。

ie

$ ls -la /usr/local/emulator
ls: /usr/local/emulator: No such file or directory
$ which emulator
/usr/local/bin/emulator
$ ls -la /usr/local/bin/emulator
lrwxr-xr-x  1 user admin  64 13 Aug 09:56 /usr/local/bin/emulator -> /usr/local/Caskroom/android-sdk/3859397,26.0.1/emulator/emulator
$ sudo ln -s /usr/local/Caskroom/android-sdk/3859397,26.0.1/emulator /usr/local/emulator
Password:
$ ls "/usr/local/bin/../emulator/qemu/darwin-x86_64/qemu-system-i386"
/usr/local/bin/../emulator/qemu/darwin-x86_64/qemu-system-i386

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

相关问题 在 Android 模拟器中运行 npx react-native CLI 时出错 - Error in running npx react-native CLI in Android emulator 在android模拟器中运行react-native - running react-native in android emulator 无法使用 react-native 应用程序在 android 模拟器上登录 Google 帐户 - Could not sign in Google account on android emulator with react-native app 无法在Android模拟器上运行现有的react-native项目 - Trouble running existing react-native project on Android emulator 在Android模拟器上运行react-native项目不起作用 - Running react-native project on Android emulator doesn't work React-Native:错误无法安装应用程序。 确保您正在运行 Android 模拟器 - React-Native: error Failed to install the app. Make sure you have an Android emulator running 在Android上运行时的React-native错误 - React-native error when running on android 无法启动模拟器。 原因:模拟器在启动前退出 en React Native when react-native run-android - Failed to launch emulator. Reason: Emulator exited before boot en React Native when react-native run-android 尝试启动 react-native android 应用程序时出错,未设置 JAVA_HOME,在您的路径中找不到 java 命令 - Getting error trying to launch react-native android application, JAVA_HOME is not set, no java command could be found in your path Android 模拟器未加载 react-native 应用程序 - Android simulator is not loading react-native application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM