VS Code and gradle - new install

First install of VS Code and WPI 2022. When going to create new project WPI Build Robot Code i get the following. I have read through posts, and I only found where OneDrive can cause this problem. OneDrive is not enabled on this computer. Other ideas?

Executing task: gradlew build -Dorg.gradle.java.home=“C:\Users\Public\wpilib\2022\jdk” <

‘gradlew’ is not recognized as an internal or external command,
operable program or batch file.
The terminal process “cmd.exe /d /c gradlew build -Dorg.gradle.java.home=“C:\Users\Public\wpilib\2022\jdk”” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

This error usually means you opened the wrong folder in vscode. The folder containing build.gradle and gradlew.bat needs to be the root folder opened in vscode. If it’s in a subfolder, that error will occur.

forgot to mention, I did a search and that file doesn’t exist anywhere. I reloaded WPI Install and watched it install gradle. I don’t know why it’s really not. I am an admin on this pc.

Can you share a link to your code in github? At the very least, a screenshot of your project in vscode (showing the file explorer and all the files at the root folder for your project)

that’s the problem, I get this error when launching Build Robot Code. I get the choose Java, then I get that error. So can’t even start a new project.

I’m confused. If you haven’t created a project, why are you trying to build code?

Please follow the steps here: Creating a Robot Program — FIRST Robotics Competition documentation

Sorry, I got confused, in the pictures it showed build robot code highlighted and I mistook that for what I should be selecting.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.