颤抖:无法运行基本的hello world程序,因为'任务':app:packageDebug'执行失败。 '

时间:2020-07-08 06:58:03

标签: android android-studio flutter gradle

我是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)

3 个答案:

答案 0 :(得分:4)

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

答案 1 :(得分:0)

我建议重新下载flutter SDK,并使用Microsoft VSC代替Android Studio。它的轻巧和轻巧给您的PC带来很大压力。

答案 2 :(得分:0)

我遇到了同样的错误,命令flutter clean有效。