无法在Android上运行React Native

无法在Android上运行React Native,android,react-native,android-studio,Android,React Native,Android Studio,在遵循React Native的官方指导原则后,我出现了此错误: 我试图打开模拟器并再次运行命令,但我得到了相同的错误 info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 967 file(s) to forward-jetify. Using 4 workers... info Startin

在遵循React Native的官方指导原则后,我出现了此错误: 我试图打开模拟器并再次运行命令,但我得到了相同的错误

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
/bin/sh: adb: command not found
info Launching emulator...
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 initialize class org.codehaus.groovy.runtime.InvokerHelper

* 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 1s

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: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081```

您应该连接android设备(激活开发者模式)或从中打开模拟器
Android studio的AVD管理器

请从项目文件夹内的终端运行以下命令

export ANDROID_HOME=/Users/{yourusername}/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH

然后
npm运行android

您没有安装任何模拟器。您可以在Android Studio中安装emulator,或将您的Android手机连接到您的计算机进行测试。如果emulator或Android设备已连接,请检查
adb
路径配置是否正确。