【问题标题】:flutter: can't run a basic hello world program because ' Execution failed for task ':app:packageDebug'. '颤振:无法运行基本的 hello world 程序,因为“任务执行失败:app:packageDebug”。 '
【发布时间】:2020-10-28 12:46:51
【问题描述】:

我是 Flutter 和 android studio 的初学者,当我尝试运行一个非常基本的 hello world 程序时,我得到了这个:

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.FileNotFoundException: D:\flutter\newapp\build\app\intermediates\signing_config\debug\out\signing-config.json (Access is denied)

* 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 16s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Running Gradle task 'assembleDebug'...

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.FileNotFoundException: D:\flutter\newapp\build\app\intermediates\signing_config\debug\out\signing-config.json (Access is denied)

* 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 2s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1

我试过flutter clean,但没用。我通过 android studio 手动清除缓存也不起作用。我终于重新启动了我的机器,但也没有用。

我没有运气和解决方案。任何帮助将不胜感激。

(运行 Windows 10)

【问题讨论】:

标签: android android-studio flutter gradle


【解决方案1】:

转到路由D:\flutter\newapp\build\app\intermediates\signing_config\debug\out\,删除文件signing-config.json,然后再次运行。

【讨论】:

    【解决方案2】:

    我建议重新下载 Flutter SDK,并使用 Microsoft VSC 而不是 Android Studio。它的轻量级和剂量会给你的 PC 带来很大的压力。

    【讨论】:

    • 很遗憾,我不能这样做,因为我已经购买了关于 Flutter 的 udemy 课程,而教授使用的是 android studio,所以我想与她保持同步。
    • 很好...但是您使用的是什么版本的 Flutter SDK?你下载的是稳定版吗?
    • 是的,它是一个稳定的版本。颤振 1.17.5.
    【解决方案3】:

    我遇到了同样的错误,命令 flutter clean 起作用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-14
      • 2020-10-11
      • 2016-09-17
      • 2020-04-04
      • 2020-05-30
      • 2021-08-30
      • 2021-11-01
      相关资源
      最近更新 更多