Error when update a old robot code to the current version


We are trying some issues with updating our 2020 robot to the current version. We tried everything that we would.

The issue is that I’m trying to compile the 2020 robot code for an event, but I’m getting error like ‘an exception error with Gradle RoboRIO version’. Can anyone help me with this?

It’s hard to know for sure without seeing the exact, full text of the error.

Generally, each year, the roboRIO has to be reimaged up to the latest before code can be loaded on. Can you confirm the RIO has been imaged with the appropriate version ('20 or '22) for the version of wpilib you’re building with?

The reading stacktraces article may also be helpful.

Yes, the current roboRIO version is 2022.4.1

What is the version in your build.gradle? Should be in the plugins section.

import edu.wpi.first.gradlerio.deploy.roborio.RoboRIO
plugins {
    id "java"
    id "edu.wpi.first.GradleRIO" version "2022.4.1"

I’m using gradle 7.4 something. And yes, I changed the version to 2022.4.1. But still it is not working

IS the code on github? IF so we could pull it down and see if we get the compile error.

It is at compile time and not deploy to rio right?

Did you update your vendor dependencies?

Is your dev environment from a 2022 install?

I have updated the vendordeps.

I don’t know if the dec environment is from 2022, here is github repo

When I tried to bring it up in Visual Studio I got this error

IF I select no I get broken dependencies. Did you get a pop up like this?

If I select yes I get taken to an import page.

Then it creates a new project with a bunch of broken dependencies because some things have moved . There were several breaking changes

You should be able to fix these by importing the right packages. And a few other code changes.

But if you close your project and open it and you don’t get these you are probably not on a 2022 version of the plugin.

You can find the plugin version by going to View->Extensions and selecting the wpilib extension

If you are on the v2022.4.1 version and you don’t get the import dialog you can manually import

If you aren’t on the right plugin you will need to install the 2022 version of wpilib

1 Like

This line is the problem.

You are attempting to build code with the 2020 WPILib dependencies, and load it onto a RIO that has been imaged with 2022.

Per Bmongar, you will need to perform an update process to align the vsCode development environment & extension, the RIO Image, and the WPILib dependencies.

1 Like

My team “imported” a few projects and it was easier to create a new 2022 project and copy the old source files into the new project (delete the new files that you don’t need). Add the current vendor libraries and possibly change a couple of lines of code for WPILib moving a few classes. Generally that took about the same amount of time that it took to read this thread.


I have changed in my branch that I have it in my computer, I did all the changes with build.gradle version and plugin.

Can you publish an updated version to GitHub?


Keep in mind that the folks trying to help in this thread aren’t physically with you - they haven’t seen all the steps you’ve taken, and don’t know when you’ve changed something or tried an experiment unless you tell them.

Keep in mind too that statements like “Have you tried…” and “X is a problem” aren’t statements against you or your abilities - they’re attempts to get more details and propose experiments for you to run.

Rather than saying “I’ve already done that”, do a more detailed explanation of what you actually did. Screenshots, exact text of error messages, and pushing changes to Github all help tell that story of exactly what has happened.

A couple thousand teams have successfully updated codebases to 2022 over the past year. The process is unlikely to be fundamentally broken. The core goal here is to figure out what about your setup is unique that prevents the process from going the same way it did for others.

How to ask a question is a bit old, remarkably detailed, and occasionally ignores peoples emotions… but overall is a good guide for folks when it comes to seeking help with software-related issues online.

Can you please list all the new 2022 WPILib vendordeps?

If you are looking for the links to the online vendor dependency installs.

1 Like