-
Notifications
You must be signed in to change notification settings - Fork 0
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.
If you need to import a class from a library that is not already in the frc library that we work with, follow these steps
Solution (click)
The reason was that you need a vendor library to use certain imports. Here's how to fix it:
-
Download the vendor library. This can be found online. For example, the link for the CTRE Phoenix vendor library is https://store.ctr-electronics.com/software/
-
Go to WPILib
-
Right click build.gradle (just under .gitignore)
-
Select "manage vendor libraries"
-
Select "Install new libraries (offline)". It is advised that you choose the offline option as it allows you to code without access to the wifi.
-
Select the box for the library that you want to install
-
Let WPILib make a build. This build might fail, but it doesn't really matter (I don't think). Then check that you can import the necessary classes.
If for whatever reason you realise you don't need a vendor library, here is how to uninstall it
Solution (click)
Here's how to fix it:
- Go to WPILib
- Right click build.gradle (just under .gitignore
- Select "manage vendor libraries"
- Select "manage current libraries"
- Select the boxes for the library that you want to uninstall
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:
-
Press
Ctrl
+Shift
+'
in WPILib VS Code. A terminal should open. -
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).
-
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. -
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.
-
Open WPILib VS Code, press Ctrl+K then Ctrl+O to open a folder, then select the new location of the code folder again.
When trying to write code that uses the WPI_TalonFX class, an error is raised saying "WPI_TalonFX cannot be resolved to type"
Solution (click)
The reason was you have not installed the CTRE Phoenix library. Here's how to fix it:
- Go to https://store.ctr-electronics.com/software/
- Download the Phoenix FrameWork Installer
- When your system tells you that it has an "unknown publisher", select "More info" and choose to trust it anyway. (Not sure about Mac, but probably some similiar process)
- Follow the instructions on the installer. When in doubt about whether you need to download one of the options prompted, just download it. There is always an option to uninstall it later.
- Follow the instructions in "Installing a vendor library" to install the vendor library into WPILib VSCode.
Shuffleboard has entries DB/String..., DB/Button..., DB/Slider... that aren't set in my code.
Solution (click)
The reason was that the Driver Station creates these entries behind the scenes, as explained here, in their "FRC PC Dashboard" which we aren't using (we are using Shuffleboard instead). You can:
- Remove the entries from Shuffleboard by selecting them (drag to form a rectangle around them), right-clicking them and clicking "Remove".