简体   繁体   中英

flutter: can't run a basic hello world program because ' Execution failed for task ':app:packageDebug'. '

I'm a total beginner to flutter and android studio and as I was trying to run a very basic hello world program I got this:

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

I've tried flutter clean but that didn't work. I manually cleared cache through android studio that didn't work either. I finally rebooted my machine and that didn't work either.

I'm out of luck and solutions. Any help would be appreciated.

(running windows 10)

Go to the route D:\flutter\newapp\build\app\intermediates\signing_config\debug\out\ and delete the file signing-config.json then run again.

I would recommend Redownloading the flutter SDK, and use Microsoft VSC instead of Android Studio.Its lightweight and dosent pose much stress on your PC.

I had the same error, the command flutter clean worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM