所以我试图运行我的flutter项目,然后我得到了这个错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> java.nio.file.FileSystemException: C:UsersASUSDesktopProgramminFlutterapp_with_firebasebuildappintermediatesmerged_java_resdebugout.jar: The process cannot access the file because it is being used by another process.
* 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 3s
Exception: Gradle task assembleDebug failed with exit code 1
我试图做:File > Invalidate Chaches/Restart
在Android工作室,但它不会解决问题。我也试着做flutter clean
,然后flutter run
,但它仍然显示我同样的错误。
我现在不知道该做什么,希望你能帮助我。
谢谢你!
我对SysInternals
和jps
做了更多的挖掘,结果发现Kotlin语言服务器没有释放构建文件夹上的锁。对我来说,卸载VS Code fwcd Kotlin扩展(如果需要,用不同的Kotlin语言扩展替换)足以解决这个问题。
在Android Studio上,我所能建议的就是禁用/卸载Kotlin插件,看看它是否能为你修复它。