Reputation: 103
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
Upvotes: 7
Views: 9401
Reputation: 11
I solved by doing as below code in react native.
go to android cd project/android
then
./gradlew --stop
./gradlew clean
Upvotes: 1
Reputation: 1846
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
.
Upvotes: 20