【发布时间】:2020-10-01 02:20:17
【问题描述】:
在此处遵循 React Native 的官方指南后,我收到此错误: https://reactnative.dev/docs/environment-setup 我试图打开模拟器并再次运行命令,但我得到了同样的错误。
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 Studio 中安装模拟器或将您的安卓手机连接到您的机器进行测试。
-
如果模拟器或安卓设备已经连接,请检查您的
adb路径是否配置正确。
标签: android react-native android-studio