Build fails after 2 times build of the application in flutter

久未见 提交于 2020-02-02 11:37:26

问题


After building my flutter application in VS code, I successfully run the app, everything works fine. But after 2 or more times of restart of the application, whenever I run my code again, the build gets failed. This is the error pops up.

Target debug_android_application failed: FileSystemException: Cannot copy file to 'J:\flutter_projects\webdoc\build\app\intermediates\flutter\debug\flutter_assets\assets\images\background.png', path = 'J:\flutter_projects\webdoc\assets\images\background.png' (OS Error: Access is denied.
, errno = 5)
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 9s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        10.2s
Gradle task assembleDebug failed with exit code 1

When first time this error has occured, I cut all the files from the current directory and copied into other directory, and then it works again fine. But even now after running 2 or 3 times again the error pops up. Is there any fix available to this problem?

I tried deleting the .vscode, rebuilding again, but still its the same!!


回答1:


This problem can be solved by turning of Windows Controlled Folder AccessSteps to turn of windows cont



来源:https://stackoverflow.com/questions/59450634/build-fails-after-2-times-build-of-the-application-in-flutter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!