【发布时间】:2021-07-06 07:13:18
【问题描述】:
我正在尝试在 Android 模拟器中运行我们的 react 本机应用程序,yarn android 模拟器启动但应用程序没有启动,几秒钟后我收到以下错误:
yarn run v1.22.10
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1755 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: spawn ./gradlew EACCES
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
该项目可以在 XCode (ios) 中完美运行,也可以在我同事的笔记本电脑(使用 Windows)中运行。
我使用的是 Macbook Air m1,macOS 11.3.1,SDK 平台:Android S,Android Studio 4.2.2,yarn 版本 v1.22.10,节点 v15.12.0,
【问题讨论】:
标签: android react-native android-emulator