简体   繁体   English

macbook m1:错误无法启动模拟器

[英]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.我建议您观看此视频,这可能对您的情况有所帮助。

See this also.也见此。

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

相关问题 在 M1 Macbook 上反应原生运行 iOS 的构建错误 - Build error of react native run iOS on M1 Macbook 在新的 macbook pro M1 上安装错误 pod - Error pod installing on new macbook pro M1 反应本机项目不在 MacBook M1 上构建 - react native project not build on MacBook M1 Pod 安装在 m1 macbook 上失败 - Pod install fails on m1 macbook 在带有 Apple M1 芯片的 Apple MacBook Pro 中运行“react-native run-android”命令时无法检测到模拟器 - Unable to detect emulator when `react-native run-android` command is ran in Apple MacBook Pro with Apple M1 Chip 无法为 Macbook Air M1 上的 XCode 中的目标 arm64 错误加载标准库 - Unable to load standard library for target arm64 error in XCode on Macbook Air M1 尝试在 macbook m1 上安装 pod 时出现只读文件系统错误 - Read-only file system error when try to install pod on macbook m1 无法解决 Macbook M1 上 React Native 应用程序中的资产模块 Metro 捆绑包错误 - Unable to resolve assets module metro bundle error in React Native app on Macbook M1 苹果 M1 上的 Android 模拟器大部分时间都提供 INSTALL_FAILED_INSUFFICIENT_STORAGE - Android emulator on apple M1 giving INSTALL_FAILED_INSUFFICIENT_STORAGE most of the time Android 工作室模拟器皮肤与 M1 Pro - Android studio emulator skin with M1 Pro
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM