gpt4 book ai didi

flutter - 在 flutter 中运行应用程序时,任务 ':app:cleanMergeDebugAssets' 的执行失败

转载 作者:行者123 更新时间:2023-12-03 02:41:52 24 4
gpt4 key购买 nike

在 Visual Studio Code v1.46.1 中运行应用程序时出现主要错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:cleanMergeDebugAssets'.
> Unable to delete directory 'E:\ACNO\Flutter\jots_mobile\build\app\intermediates\merged_assets\debug\out'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- E:\ACNO\Flutter\jots_mobile\build\app\intermediates\merged_assets\debug\out\flutter_assets\assets
- E:\ACNO\Flutter\jots_mobile\build\app\intermediates\merged_assets\debug\out\flutter_assets\packages\cupertino_icons
- E:\ACNO\Flutter\jots_mobile\build\app\intermediates\merged_assets\debug\out\flutter_assets\packages
- E:\ACNO\Flutter\jots_mobile\build\app\intermediates\merged_assets\debug\out\flutter_assets

* 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 50s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
此错误在 flutter clean 后得到解决但即使这样也显示以下错误
以下是 flutter clean 的输出
Failed to remove build. A program may still be using a file in the directory or the directory itself. To find and stop such a program, see:
https://superuser.com/questions/1333118/cant-delete-empty-folder-because-it-is-used
Deleting build... 19ms
Failed to remove E:\ACNO\Flutter\jots_mobile\.dart_tool. A program may still be using a file in the directory or the directory itself. To find and stop such a program, see:
https://superuser.com/questions/1333118/cant-delete-empty-folder-because-it-is-used
Deleting .dart_tool... 21ms
Deleting Generated.xcconfig... 4ms
Deleting flutter_export_environment.sh...
即使我杀死了在 this answer 中提到的使用 build 和 .dart_tool 文件夹的进程, flutter clean将显示相同的错误
所以,现在我必须手动转到文件资源管理器并删除 build 和 .dart_tool 文件夹,这是这里的主要问题!
摘要:运行应用程序时的主要错误在 flutter clean 后得到解决但即使这样也显示错误,所以现在我必须手动删除 build 和 .dart_tool 文件夹!

Q. How can I resolve these issues?


更新:刚刚注意到,当我使用“f5”在 VS 代码中运行我的程序时会发生此错误,而不是在使用 flutter run 时发生此错误。命令在终端或 Android Studio 中,但是一旦它发生在“f5”上,它就会发生在 flutter run命令和Android Studio。我猜 VS Code 中启用此“f5”快捷方式的扩展程序有问题!
查看这些 GitHub 问题 • flutter/flutterfwcd/vscode-kotlin

最佳答案

问题在于 VS Code 中的 Kotlin 插件,因此删除它应该可以解决我们的问题!
现在我可以在 Debug模式下运行项目。下面是我的 flutter 医生

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.4, on Microsoft Windows [Version 10.0.17763.1282, locale en-MY)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.46.1)
[√] VS Code, 64-bit edition (version 1.46.1)
[√] Connected device (1 available)
我在 VS Code 中重新安装了 Kotlin 插件,问题又回来了。我删除了它,项目运行。所以我猜是插件。我使用和删除的插件是 Kotlin 0.2.17任何人都可以仔细检查问题是否是因为这个?

关于flutter - 在 flutter 中运行应用程序时,任务 ':app:cleanMergeDebugAssets' 的执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62506614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com