gpt4 book ai didi

android - React Native WebStorm Emulator 无法启动 - 错误无法启动模拟器。原因 : No emulators found as an output of `emulator -list-avds`

转载 作者:行者123 更新时间:2023-12-04 14:40:34 45 4
gpt4 key购买 nike

我是 WebStorm 和 React Native 的新手,在设置我的环境时遇到了一个错误,与我看到的其他帖子相比,我的环境显得独特。

客观的

我在 WebStorm 中设置了一个默认项目,我的目标是在 Android 模拟器上运行该项目,我使用的是 Windows PC。

我试过的

我在 WebStorm 中设置了一个简单的调试配置

Picture of my debug configuration

我还通过 Android Studio 下载了一个 Android 模拟器,并在我的计算机上运行它。

Picture of android simulator running beside my WebStorm IDE

现在,当我为我的调试模拟器单击运行时,我收到以下错误:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
'adb' is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator...
infoerror Installing the app...
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.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> 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 'C:\Users\Nicol\WebstormProjects\Dog\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 13s

Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> 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 'C:\Users\Nicol\WebstormProjects\Dog\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 13s

at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\Nicol\WebstormProjects\Dog\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.

其他信息

这是我的路径系统变量的图片:

a picture of my Path System variables

最佳答案

adb不在您的 %PATH% 上;确保添加 adb.exe 所在的文件夹位于(通常是 $ANDROID_HOME/platform-tools ,其中 $ANDROID_HOME 是您的 Android SDK 安装目录,通常是 C:\Users\Your.Name\AppData\Local\Android\sdk ,您可以在 Windows cmd 控制台中运行 where adb 命令来找到它)到 %PATH% 下系统环境变量然后重新启动 WebStorm。

您还需要定义 %ANDROID_SDK_ROOT%错误消息中每个建议的环境变量

关于android - React Native WebStorm Emulator 无法启动 - 错误无法启动模拟器。原因 : No emulators found as an output of `emulator -list-avds` ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58888381/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com