Skip to content

Common Bugs And FAQs

WebCoder49 edited this page Nov 5, 2023 · 13 revisions

🤔 Common Bugs and FAQs

Please contribute any general problems you encounter here and/or any solutions to the questions below by clicking "Edit" in the top-right corner, then let us know on MS Teams. Any longer tutorials/explanations should go in their own pages.


Build fails as could not find main Gradle class

When trying to build robot code in WPILib VS Code, the output gives this error:

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
Solution (click)

The reason was that a folder named in non-English letters contained the code folder. Here's how to fix it:

  1. Press Ctrl+Shift+' in WPILib VS Code. A terminal should open. image

  2. The file path will contain non-English characters, and that is the cause of the bug. Navigate in File Explorer to the parent folder of the path, selecting the folder the path refers to. This is your cloned version of the GitHub repository (the code). image

  3. Close GitHub Desktop if it is open and close WPILib VS Code. Now, either rename the non-English folder (汉字 here) or move (don't copy) the code folder (2023-offseason) to another folder so the path shown at the top of File Explorer consists of only letters, numbers, spaces, -s, _s, etc. image

  4. Open GitHub Desktop and switch to the Robotics repository (2023-offseason here). Click "Locate" on the error message that shows up and select the new location of the code folder.

  5. Open WPILib VS Code, press Ctrl+K then Ctrl+O to open a folder, then select the new location of the code folder again. image