Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot lock Build Output Cleanup Cache

I am having issues with my flutter project. Whenever I run the flutter build apk command. I get the following error message. I tried flutter clean but it does not solve the problem. Here is my error message.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not determine the dependencies of null.
   > Could not resolve all dependencies for configuration ':classpath'.
      > Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
         > Cannot lock Build Output Cleanup Cache (C:\Users\JUSTINE NALWOGA\Desktop\EDUSELF FINAL\eduself\android\.gradle\buildOutputCleanup) as it has already been locked by this 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 5m 22s
Running Gradle task 'assembleRelease'...                          337.9s
Gradle task assembleRelease failed with exit code 1
like image 497
Zenji Avatar asked Jun 06 '26 06:06

Zenji


1 Answers

Try running this command in a terminal,

find ~/.gradle -type f -name "*.lock" -delete

or

Go to /.gradle folder and manually delete all files ending with .lock.

Then run flutter clean,

flutter pub get and finally run

flutter build apk.

like image 132
rrttrr Avatar answered Jun 07 '26 19:06

rrttrr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!