在颤抖的情况下两次构建应用程序后,构建失败 [英] Build fails after 2 times build of the application in flutter
问题描述
用VS代码构建Flutter应用程序后,我成功运行了该应用程序,一切正常.但是在重新启动应用程序两次或更多次之后,每当我再次运行代码时,构建都会失败.这是错误弹出.
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
第一次发生此错误时,我从当前目录中剪切了所有文件,然后将其复制到其他目录中,然后再次正常运行.但是即使现在再次运行2或3次后,仍会弹出错误.有没有针对此问题的修复程序?
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?
我尝试删除.vscode,然后重新构建,但仍然相同!
推荐答案
在更新flutter之后,我遇到了同样的问题,我删除了flutter SDK,然后再次下载并解决了问题.
I had the same problem after updating flutter, I deleted the flutter SDK and downloaded again and the problem solved.
这篇关于在颤抖的情况下两次构建应用程序后,构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!