Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not create service of type FileAccessTimeJournal using GradleUserHomeScopeServices.createFileAccessTimeJournal() error in gradle

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

A detailed solution would be appreciated. Also, I am unaware of 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.)

like image 718
Jatin Pandey Avatar asked Jan 27 '20 09:01

Jatin Pandey


6 Answers

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 :)

like image 55
Arina Naumova Avatar answered Oct 22 '22 05:10

Arina Naumova


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
like image 37
Divya Avatar answered Oct 22 '22 03:10

Divya


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
like image 38
DeanZ Avatar answered Oct 22 '22 05:10

DeanZ


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!.

like image 45
Carles Roch-Cunill Avatar answered Oct 22 '22 05:10

Carles Roch-Cunill


I had the same issue, i run the following command and it worked for me,

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

like image 20
Muhammad Sulaiman Avatar answered Oct 22 '22 04:10

Muhammad Sulaiman


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

like image 43
Roman Stakhovskiy Avatar answered Oct 22 '22 03:10

Roman Stakhovskiy