Build/deploy robot code failure

Hello. I am currently part of team 6922 and I have little experience with coding. Now that we wanted to start the code, I proceeded to build it. However, it fails when the code was imported to the 2020 VS code. Then I tried to build the code without importing it, and it worked. But, when I try to deploy it, there is this error in the image. Please help us and thanks!

Please show the entirety of the failure message (you need to scroll up in the window that says BUILD FAILED). If you are copy-pasting it, please surround with triple backticks (```) to properly quote it.

I can send you the error message ASAP during this weekend. I only have internet in my phone due to school policies. Bare with me, sorry.

Or take a photo of it… you can expand the console window to show more.

Well. Right now I used the 2019 version of the code, without it being imported. But now it cannot deploy the code because it doesn’t find the roboRIO. Also, the roboRIO has a red light on communications. Any advice on how to fix it?

Follow the direction to “scroll up in this error log for more information”. The code version needs to match the roboRIO version, which is probably the issue. If you’ve updated your RoboRIO to 2020, you will need to install WPILib 2020 and follow the steps in importing a Gradle project to upgrade your project to 2020.

The RoboRIO is already updated, only that the imported code is unable to build. I will send you all the information from the terminal ASAP when I get internet in my laptop. Thanks.

Here is the message that the terminal gave me when trying to build the code of the robot after importing the 2019 version into the 2020 VS code.error.txt (6.9 KB)

Based on those messages you need to install the vendor library again. Ours is currently pointed at http://devsite.ctr-electronics.com/maven/release/com/ctre/phoenix/Phoenix-latest.json. Right click the build.gradle file and choose manage vendor libraries. Install new library online is the next option to take and use the URL I posted in the body of this post…

I did that and it wasn’t successful at building the code. However, before installing this library there were are 120 problems listed on the terminal but now there are only 15.

Can you post a photo or the text of the 15 errors?

Sure. They are mostly about the claw code and pistons code (that we used lastyear) but aren’t really being used this time. Should I remove them or leave them there since they do nothing for now?

Your clawintake_command is trying to import a class that doesn’t exist:

Here is the class list from wpilibj.

There isn’t a GamepadBase class. Is this old code that you are trying to convert for the year?

There used to be a GamepadBase class, but that was deprecated a while ago and is now seemingly gone.

You can probably just use the newer XboxController class to get whatever you need done in there.

This is code that I am trying to use from last year. About the GamepadBase, we used a ps3-like controller for an elevator system we had last year. How can I import the new class to the code?

If it’s a gamepad that plugs into the computer via USB, just use the XboxController class I linked to above. It will probably do everything you need.

Most of those are 6-axis controllers with 10 buttons.

Just instantiate the xboxcontroller with the proper controller port (like every joystick derivative from past years) and you’ll be good to go.

What do you mean by instantiate? However, the real problem is not being able to build and deploy the code, as well that there is no connection between the RoboRIO and the computer. Please help me on communications first and then, if I have any problems, help me with controllers/code. Thanks!

Instantiation is what happens in Java when you use the new keyword to create an object.

With regard to no communication, follow these steps to see where you are having problems.

Edit to add:
You should focus on the Build step of the code right now, you’ll never be able to deploy code that doesn’t compile.

Right, I will try all this and inform you about it. Thanks for the help.

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