15
votes

I am facing this issue while building flutter apps in VS Code and I could not find any simple solution for this issue. Please help me resolve this issue.

FAILURE: Build failed with an exception.

What went wrong:

Could not create service of type FileAccessTimeJournal using GradleUserHomeScopeServices.createFileAccessTimeJournal(). Timeout waiting to lock journal cache (/home/jatin/.gradle/caches/journal-1). It is currently in use by another Gradle instance. Owner PID: 3813 Our PID: 5034 Owner Operation: Our operation: Lock file: /home/jatin/.gradle/caches/journal-1/journal-1.lock 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 1m 2s
Running Gradle task ‘assembleDebug’…
Running Gradle task ‘assembleDebug’… Done 63.5s
Gradle task assembleDebug failed with exit code 1

Please tell me full solution as I am a complete beginner. I also do not know how to use the stacktrace option .(* 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.)

8

8 Answers

18
votes

Had the same problem, these actions worked for me: Close IDE. Go to windows task manager -> processes. Find java.exe processes there and end them.

Hope this helps :)

13
votes

I had the same problem but thankfully I found a way to do it without restarting the container. Ran the following command to stop daemons on Gradle. This made the other daemon stop and blocking my Gradle runs

./gradlew --stop 

OR

gradle --stop
9
votes

That Gradle failure message would be:

Gradle sync failed: Timeout waiting to lock daemon addresses registry [...].
It is currently in use by another Gradle instance.

Owner PID: 4567
Our PID: 5678
Owner Operation: ...

If you're using macOS or linux for development, just kill the owner process:

sudo kill -9 4567
3
votes

I had the same problem when interrupting a batch file that was calling individual groovy scripts like

os.system('./gradlew chromeTest --tests=\"MyTestScript_1\")

The batch file contains several calls like the one above, and I interrupted it due to errors in my scripts. Once the errors were corrected, I tried again to run the batch file but then I got the error reported in this ticket.

To solve it I tried to stop gradle with

./gradlew --stop

or

gradle --stop

and then restarting gradle with

./gradlew --daemon

But when executing again my batch file I still got the same error message. The only way I was able to make it work again was rebooting my container. Heavy handed but it worked. I would like to know a better way!.

1
votes

My solution was to downgrade the gradle version from 6.8.2 to 6.7.2

1
votes

I had the same problem.

Gradle sync failed: Timeout waiting to lock daemon addresses registry [...]. It is currently in use by another Gradle instance.

Owner PID: 4567 Our PID: 5678 Owner Operation: ...

My solution was to delete .gradle caches folder (In Mac you can use Command + Shift + . to get .gradle folder)

/user/..../.gradle/caches

Everything works fine.

0
votes

I tried the above solution but nothing worked . Restarting my macbook solved the issue .

So , in case above solutions are not working try the old way i.e. restarting !!

0
votes

My problem was because I tried to start gradlew by WSL bash instead of by Cygwin's which resulted in an error:

> Could not create service of type FileAccessTimeJournal using GradleUserHomeScopeServices.createFileAccessTimeJournal().
   > java.io.IOException: Invalid argument

I have noticed a message:

The daemon log file: /mnt/c/srv/gradle/daemon/6.6.1/daemon-29382.out.log

For Cygwin that path should have been started with /cygdrive/c.