Error "The import com.revrobotics cannot be resolved"

Hello! we have been having a problem using the REV spark max imports, every import that uses the “com.revrobotics” gets flagged as well as other imports pertaining to rev robotics, as seen below

I have tried adding the maven files and vendor drops manually and trying to re-download the .json files both off and online . are there any other ways to fix this problem? Thanks in advanced.

1 Like

Does the code compile successfully? Or do you get a compiler error? If successful, then this is just a vscode intellisense issue. If there’s an error, please share the output of “show project info” (I might have the specific phrasing wrong)

when i try to compile the code, it errors with the message “GradleRIO detected this build failed due to a Compile Error (compileJava).”, “Check that all your files are saved, then scroll up in this log for more information.”, and “FAILURE: Build failed with an exception.”

Scroll up in the output. Theres more there

these?

Did you use the command pallet to create a new WPILIB project? Did it compile before changing anything? It seems like you have a configuration issue…

Ontop of missing code. Like the file DriveCommand is supposed to be in the commands folder.

We used the command pallet to create the WPLIB project and it did compile before adding the imports. is there anything else it could be?

I believe the package line needs to be the first line of code.

we tried this in the robot.java and it did not fix the error, we also tried to put it in a separate subsystem and it did not fix it. after looking around on CD, there was a fix to delete all instances of “windowsx86” that changed the red underlines to yellow and now the code builds successfully.

Glad you got it to work!

Running “Clean Java Language Workspace” fixes this error whenever I get it in VSCode.

I’m having the same problem, can you give me the steps you used to solve it?