Flutter:FAILURE:构建失败,出现异常

时间:2020-08-23 21:12:03

标签: android-studio flutter gradle build.gradle

自从Android Studio的最新更新(今天是2020年8月23日)以来,每次创建新的flutter项目时,我都无法运行它。即使我不修改一行代码,而只是创建一个空白的新项目,然后运行它。

我以前的所有flutter项目都可以在我的VD中运行,没有任何问题。但由于构建失败,我无法从事新项目。

  1. 我使用菜单“文件/无效缓存/重新启动...”清空了缓存
  2. 我使用“ flutter upgrade --force”升级了Flutter,然后像在this post中一样使用“ flutter run -v”升级了,但是对我来说不起作用。

我通过在线课程学习颤动,但是我不知道该怎么解决。 你有解决方案吗 ? 谢谢

这是控制台中发生的事情(带有一个新的flutter应用程序项目):

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml: AAPT: error: file failed to compile.

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-hi\values-hi.xml: AAPT: error: file failed to compile.

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-de\values-de.xml: AAPT: error: file failed to compile.

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-lo\values-lo.xml: AAPT: error: file failed to compile.

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-pt\values-pt.xml: AAPT: error: file failed to compile.

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-lt\values-lt.xml: AAPT: error: file failed to compile.

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-hr\values-hr.xml: AAPT: error: file failed to compile.

   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > Android resource compilation failed
        C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-lv\values-lv.xml: AAPT: error: file failed to compile.


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

1 个答案:

答案 0 :(得分:0)

从C:\ Users \ Steeve \ Documents \ Flutter \目录中删除androidstudio文件夹。