簡體   English   中英

任務':app:installDebug'的執行失敗反應本機應用程序

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

嗨,當我嘗試通過以下方式在我的真實 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

試試這些步驟。

  1. 刪除項目中的節點模塊文件夾。
  2. 刪除android/build build 文件夾
  3. 關閉所有正在運行的終端。
  4. 確保您已在您的環境中安裝了 adb 驅動程序。 如果沒有安裝 adb 驅動程序。 (適用於 macOS /適用於 Windows )
  5. 打開新的終端窗口並在您的項目文件夾中運行npm install以重新安裝節點模塊。
  6. 最后使用react-native run-android運行你的應用

如果您使用的是 Android Studio,請確保在運行命令之前運行模擬器,並且模擬器 API 級別與 targetSdk (build.gradle) 匹配。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM