Gradle任务AssembleDebug失败

时间:2020-07-21 14:29:45

标签: android flutter gradle visual-studio-code

我在vs代码中构建了一个基本的flutter应用程序。我没有对flutter的默认应用程序进行任何更改。我在手机上运行它。

Launching lib\main.dart on POCO F1 in debug mode...
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\Users\HOME\AppData\Local\Android\sdk\licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready.
Installing Android SDK Build-Tools 28.0.3 in C:\Users\HOME\AppData\Local\Android\sdk\build-tools\28.0.3
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete.
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished.
Checking the license for package Android SDK Platform 28 in C:\Users\HOME\AppData\Local\Android\sdk\licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in C:\Users\HOME\AppData\Local\Android\sdk\platforms\android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.

然后它给出了这个错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > java.io.IOException: The request could not be performed because of an I/O device error

* 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 46m 45s
Exception: Gradle task assembleDebug failed with exit code 1

颤抖的医生没有给出任何问题

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.10586], locale en-IN)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.47.2)
[√] Connected device (1 available)

• No issues found!

我不知道现在该怎么办。

1 个答案:

答案 0 :(得分:0)

您可以尝试运行flutter clean来删除构建目录。

如果没有删除build目录,请尝试:

然后尝试重新构建/部署您的应用。