Closed aaronsteers closed 4 years ago
Hi. Thanks for the bug report. I'm looking into this.
Can you confirm you do see the "Gradle Tasks" panel in the explorer like so?:
From the logs you posted, the extension is able to correctly discover the tasks, so this is possibly just a UI rendering thing. Let me know if you see the "Gradle Tasks" panel at all.
I've attempted to replicate this issue without success (on Windows 10). To help me debugging this, can you provide a zip file with all the necessary files that demonstrates this issue? Thanks.
Hi. Thanks for the bug report. I'm looking into this.
Can you confirm you do see the "Gradle Tasks" panel in the explorer like so?:
Confirmed. This is exactly what I see in my left-hand panel.
I've attempted to replicate this issue without success (on Windows 10). To help me debugging this, can you provide a zip file with all the necessary files that demonstrates this issue? Thanks.
Yes, I'll post back later with that zip of the files. If I have time, I would like to also try without any other extensions loaded - although I'm not sure how to do that quickly since I have 20+ extensions.
Hitting the exact same issue using Insiders build as of this morning under Linux. Tasks are detected as per the logs, the tasks tree is displayed, but no tasks are listed in it.
I'll see if I can assemble a reproduction at some point--this is happening on a work-related project that I can't share.
One thing I'll note is that I'm using a multi-workspace project. I have task auto-detection off in the root folder, but on in the sub-folder containing the Gradle project. We have a monorepo with lots of different projects, so hopefully this setup works, but I wonder if that might be why things aren't appearing? Very new to VSCode.
Thanks.
Hey, I've released a couple new extension versions. Are you still experiencing this issue?
Hey, I've released a couple new extension versions. Are you still experiencing this issue?
Not sure yet, but will report back. Thanks!
I'm experiencing this too. Running the latest extension version. It seems that restarting VS Code sometimes fixes it, but sometimes it just doesn't work.
Thanks for the report @Column01. I've discovered that i'm not really handling errors very well when providing the gradle tasks to vscode. See this particular catch statement here:
I will add better logging to surface the underlying issue here.
In the meantime, I don't suppose you can provide me a zip of this project (with private code removed)?
Is there anything specific from the zip you'd need? I have the code hosted on github, but I'm not sure if I've excluded anything else you need. Here is the code (it's a minecraft mod)
This is perfect, thanks! Don't need a zip, i'll just clone. This project will possibly help me debug this issue easier, as i'm yet to replicate on my own projects.
Just a note (not sure if it matters) The gradle wrapper is an older version (4.6 I believe). It's required since Forge uses old gradle methods that will not work on new versions.
@Column01 can you confirm you see the following error? (you need enable the "gradle.debug" setting)
This looks like a different error to OP sadly. Thanks for the extra info about the version, I will look into a fix for this.
I don't see that since the tasks are showing up for me now (Like I said, restarting VS Code sometimes fixes it)
Also that appears to be a gradle error that doesn't come from your end.
In the cases where you get no tasks, are there any errors in the output panel?
(Yep i'm seeing a gradle error, doesn't mean i can't potentially prevent it from occurring, by changing how i use the tooling API for example.)
Not sure if this is helpful, but this output was in my terminal under "1: Task - Gradle Task Server":
> Executing task: ".\gradle-tasks-server.bat" 63625 <
Gradle tasks server started
Could not fetch model of type 'GradleProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.1.1-bin.zip'.
And on hitting the "refresh" button, I also see the following in OUTPUT
> Gradle Tasks
:
[debug] CLIENT MESSAGE: {"getTasks":{"sourceDir":"c:\\Files\\Source\\slalom-people-data"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Connecting to Gradle Daemon"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Run build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Evaluate settings"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Run build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Configure build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Load projects"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Configure build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Configure project :"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Configure build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Run build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Build"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Deleting unused version-specific caches in C:\\Files\\Source\\slalom-people-data\\.gradle"}}
[debug] SERVER MESSAGE: {"progress":{"message":"Build"}}
[debug] SERVER MESSAGE: {"outputChanged":{"message":"","outputType":0}}
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\nFAILURE: Build failed with an exception.","outputType":0}}
[info] FAILURE: Build failed with an exception.
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n","outputType":0}}
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n* Where:","outputType":0}}
[info] * Where:
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\nBuild file 'C:\\Files\\Source\\slalom-people-data\\build.gradle' line: 14","outputType":0}}
[info] Build file 'C:\Files\Source\slalom-people-data\build.gradle' line: 14
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n","outputType":0}}
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n* What went wrong:","outputType":0}}
[info] * What went wrong:
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\nA problem occurred evaluating root project 'dataops-project-template'.","outputType":0}}
[info] A problem occurred evaluating root project 'dataops-project-template'.
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n> .\\Dockerimage (The system cannot find the file specified)","outputType":0}}
[info] > .\Dockerimage (The system cannot find the file specified)
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n","outputType":0}}
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n* Try:","outputType":0}}
[info] * Try:
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\nRun 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.","outputType":0}}
[info] 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.
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n","outputType":0}}
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n* Get more help at https://help.gradle.org","outputType":0}}
[info] * Get more help at https://help.gradle.org
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\n","outputType":0}}
[debug] SERVER MESSAGE: {"outputChanged":{"message":"\nCONFIGURE FAILED in 241ms","outputType":0}}
[info] CONFIGURE FAILED in 241ms
[debug] SERVER MESSAGE: {"progress":{"message":""}}
[debug] SERVER MESSAGE: {"error":{"message":"Could not fetch model of type 'GradleProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.1.1-bin.zip'."}}
[error] Could not fetch model of type 'GradleProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.1.1-bin.zip'.
[debug] SERVER MESSAGE: {"getTasks":{"message":"Completed ACTION_GET_TASKS","tasksList":[]}}
UPDATE (2): There's a relative reference in the above to a file at ./Dockerimage
(.\\Dockerimage
in windows) which failed although the file was correctly in the project root. After replacing the relative reference with an absolute reference, I do get what looks like successful parsing in the OUTPUT
window - but sadly the Gradle Tasks pane still does not populate with a task list.
UPDATE (3): FWIW, the above is from a single working folder (aka, not a multi-folder workspace).
@aaronsteers seems like a gradle project setup issue. Are you able to list tasks using the Gradle wrapper directly? Eg ".\gradlew.bat tasks --all"?
In case it's helpful for anyone who finds this thread in the future, I was experiencing this same problem. No errors anywhere I could see, just no tasks would be detected.
In my case, it was due to me having added my gradlew executable in my workspace's files.exclude
list so it wouldn't appear in the explorer. It seems this extension detects Gradle via the file explorer rather than looking in the root folder or allowing a custom detection path, so if you're hiding the gradle-related files it thinks there's no Gradle and won't show anything.
I'm not sure how common of a use case it is to hide those files, so I don't know how viable it would be to add a setting to control this behavior, but just in case anyone was experiencing the same problem and nothing currently in the thread helped, I wanted to detail what the solution was in my case.
@Drakmyth Thanks for this. Indeed, a "Gradle Project" is defined by having wrapper scripts at the root as described in https://github.com/badsyntax/vscode-gradle/blob/master/ARCHITECTURE.md The extension uses the standard vscode api's to detect files, it doesn't look at the file explorer per se. I'll see what i can do to workaround this with https://github.com/badsyntax/vscode-gradle/issues/485
To everyone else in this thread: I've released a bunch of new changes and a lot of functionality has changed, so I don't think it makes sense to try debug the original issues anymore.
Please try the latest version, and if you're still having issues, please review the Troubleshooting section in the README. If you're then still having issues, please create a new issue and I'd be more than happy to attempt to help, but I can't do so anymore in the context of this thread.
Describe the bug
No tasks are appearing when I refresh the tasks view. From everything else I've seen, it looks like Gradle is working fine. I'm running Windows and I've tested (unsuccessfully) using the latest VS Code version on Windows native as well as running under WSL. Output below along with
build.gradle
content.Disclaimer: I'm new to Gradle and also new to this extension.
To Reproduce
./build.gradle
file with the following text:./settings.gradle
with the following text:(
dataops-project-template
is the name of the project and root directory)run
gradle tasks
and confirmzip
is in the list.run
./gradlew version
:Expected behavior
Expected to see gradle tasks (at least my custom task
zip
) in the "Gradle Tasks" pane.Screenshots
...
Environment (please complete the following information):
Output from "Gradle Tasks"
Does the bug still exist if you disable all other extensions?
I'm not sure how to test this but I tried disabling all task-related extentions and I still get the same result.
Additional context
Add any other context about the problem here.