Inquiry. I am on a Kotlin project that uses Gradl...
# gradle
l
Inquiry. I am on a Kotlin project that uses Gradle, with IntelliJ. From time to time, my Gradle pane in IntelliJ will just go blank. I know there’s several dozen gradle tasks defined, and sometimes it does show them and I can run them fine, but other times (like right now) it just says “Nothing to show.” I’ve done rebuilds, I’ve done refreshes, it just seems like it randomly goes on strike for a few days. Anyone else seen this? Any clue what could be going on, and how to fix it?
s
Maybe a stuck Gradle daemon? Try
./gradlew --stop
.
r
@Larry Garfield Once the issue occurs does it affect all Gradle Projects or only that specific one? Could you please share the logs (
Help -> Collect Logs and Diagnostic Data
) along with the rough time/date when the issue was occurring, so we can take a closer look at it?
l
I only have the one project I’m working on.
Running
--stop
said it stopped 2 daemons. Trying to run a command now to see if it restarts it. … Looks like it doesn’t. Or at least it doesn’t show in the IDE.
There’s… a lot of diagnostic data when I do that. 🙂 What am I looking for in there?
r
@Larry Garfield
Help -> Collect Logs and Diagnostic Data
should package all of the data needed for troubleshooting into a single ZIP. If you could share that ZIP file, that should be everything we need to start the investigation.
l
(We = are you with JetBrains?)
r
Yes, I'm the Support Engineer for Java Build Tools Team. If you cannot share the logs here due to them containing sensitive data, please use our upload service and share the upload ID instead.
👍 1
l
OK, thanks. I am OK sharing it with JB, but not with just-some-dude-in-the-Internet. 🙂 (Work computer, so I have no idea what might leak.)
Timeline: It’s been fine for a few weeks, but yesterday morning it went blank again. Still blank now. Upload id: 2024_07_24_5E38PY25He3rg77BawdNW2 (file: idea-logs-20240724-0823063177375526389629296.zip)
r
Thank you for sharing the logs! The logs don't seem to indicate any explicit issues with the Gradle component of IDEA. Just to clarify, when you mentioned the Gradle pane you were referring to the Gradle Tool Window, correct? When the issue occurs, please check the status of IDEA's Gradle Daemons (press
Shift
twice and type "`show gradle daemons`" in the Search Everywhere window), try stopping them and reopening the Project. You can also check for Gradle Daemons using
jps
console command. If the issue persists, try creating a new Gradle Project and check if it affected by the issue as well. Since I saw a number of Plugin-related errors in the logs, it might also be worth it to try temporarily disabling them: 1. Backup disabled_plugins.txt, so you can rollback, if needed 2. Settings -> Plugins -> Cogwheel icon -> Disable All Downloaded Plugins
l
Yes, the tool window.
Wow, another thing the search everywhere dialog does?? 🙂 There’s no gradle daemons running. Which… I suppose could be a problem.
So maybe the daemon crashed and can’t restart for some reason?
r
Does
jps
command show any running Gradle Daemons? Does clicking the Gradle Sync button have any effect?
l
Sync button does nothing. Running
jps
shows, this:
Copy code
94224 KotlinCompileDaemon
94215 GradleDaemon
97862 Jps
45195 Main
… But I just restarted the IDE, and this time it did fix it. In the past, it only sometimes has.
Yet the gradle daemons dialog is still showing no entries. Wha?
r
Which version of Gradle does your Project use? Did you get a chance to test if the problem persists for a newly-created Project?
l
Didn’t try on a new project. Looks like we’re on Gradle 8.8.
r
In regards to the issue with Gradle Daemons not being visible, that's a known issue, that's already been fixed - the fix should become available shortly. For the main issue, did force-stopping the Gradle Daemons helped with the issue? Does your workflow involves switching Git Branches often? Another possible workaround for this is to close all instances of IDEA, remove the
projects
folder from the System Directory and re-open the Project.
l
Force stopping did not fix it. Restarting the IDE sometimes fixes it, sometimes not. Yes, I switch Git branches a lot.
r
Could you please let me know if the Git Branches in question include
.idea
folder or any of its' files/subfolders?
l
No,
.idea
is git-ignored.
r
Try closing all instances of IDEA, renaming/removing the
projects
folder found in IDEA's System Directory and re-importing the Project (Open -> Navigate to Project's directory -> Double-click the root
build.gradle(.kts)
-> Open as Project).