[英]macbook m1: error Failed to launch emulator
I use macbook m1 and set sdk in android studio.我使用macbook m1并在android studio中设置sdk。 I follow all the process: https://reactnative.dev/docs/environment-setup .我遵循所有过程: https://reactnative.dev/docs/environment-setup 。
But I couldn't understand above process.但我无法理解上述过程。 when I run this command line from terminal.当我从终端运行此命令行时。 It says它说
zsh: command not found: sdkmanager zsh:找不到命令:sdkmanager
So I pass that process.所以我通过了这个过程。
Except for that, I installed all as doc says.除此之外,我按照文档的说明安装了所有内容。 But when I run npx react-native run-android
.但是当我运行npx react-native run-android
时。
Error message below appears.出现以下错误信息。 what is the problem?问题是什么?
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/hayat/Documents/AwesomeProject/android/local.properties'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/hayat/Documents/AwesomeProject/android/local.properties'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
at makeError (/Users/hayat/Documents/AwesomeProject/node_modules/execa/index.js:174:9)
at /Users/hayat/Documents/AwesomeProject/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/hayat/Documents/AwesomeProject/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/hayat/Documents/AwesomeProject/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
Running android emulator on m1 chip requires extra installation steps.在 m1 芯片上运行 android 仿真器需要额外的安装步骤。
I recommend you to watch this video which might be helpful to your situation.我建议您观看此视频,这可能对您的情况有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.