简体   繁体   English

任务':app:installDebug'的执行失败反应本机应用程序

[英]Execution failed for task ':app:installDebug' react native app

Hi i got this error when i try to run react app on my real android device via: react-native run-android嗨,当我尝试通过以下方式在我的真实 android 设备上运行 React 应用程序时出现此错误: react-native run-android

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all 

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Try these steps.试试这些步骤。

  1. Delete node modules folder in your project.删除项目中的节点模块文件夹。
  2. Delete build folder in android/build删除android/build build 文件夹
  3. Close all running terminals.关闭所有正在运行的终端。
  4. Make sure you have installed adb drivers in your environment.确保您已在您的环境中安装了 adb 驱动程序。 If not install adb drivers.如果没有安装 adb 驱动程序。 ( For macOS / For Windows ) (适用于 macOS /适用于 Windows )
  5. Open new terminal window and in your project folder run npm install to re-install node modules.打开新的终端窗口并在您的项目文件夹中运行npm install以重新安装节点模块。
  6. Finally run your app using react-native run-android最后使用react-native run-android运行你的应用

If you are using Android Studio, make sure you run the emulator before running the commands and the emulator API level matches the targetSdk (build.gradle).如果您使用的是 Android Studio,请确保在运行命令之前运行模拟器,并且模拟器 API 级别与 targetSdk (build.gradle) 匹配。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM