gpt4 book ai didi

android - React-Native:错误无法安装应用程序。确保您正在运行 Android 模拟器

转载 作者:行者123 更新时间:2023-12-04 15:43:02 47 4
gpt4 key购买 nike

我刚刚通过以下方式初始化了一个新的 React Native 项目:
react-native init AwesomeProject
我已经收到此错误:

BUILD FAILED in 3s

error Failed to install the app. Make sure you have an Android emulator running or a device connected. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

* 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 checkExecSyncError (child_process.js:637:11)
at execFileSync (child_process.js:655:13)
at runOnAllDevices (/Users/danale/Projects/engageMobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
at buildAndRun (/Users/danale/Projects/engageMobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:169:41)
at then.result (/Users/danale/Projects/engageMobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:135:12)
at processTicksAndRejections (internal/process/next_tick.js:81:5)

到目前为止,它只是一个样板应用程序。我使用 zsh 而不是 bash 作为命令行界面。

我也在颤振中开发,我没有遇到这个问题,它可以顺利打开 Nexus 5X 模拟器。

可能是什么问题呢?

我尝试更改权限,但事实并非如此。

最佳答案

所以显然我对 ios 有更多经验比 androidreact-native run-ios自动为你打开一个模拟器,react-native run-android不,重要的一点,类似的命令,不要做类似的事情,即打开一个模拟器。

一旦我在 Android Studio 中打开应用程序,然后转到 AVD 经理 并为 Android Studio 打开模拟器,然后运行 ​​react-native run-android ,它工作得很好。

关于android - React-Native:错误无法安装应用程序。确保您正在运行 Android 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57097192/

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