WPIlibJ library gone after AdvantageKit update

After I updated to the latest AKit beta (v4.0.0-beta-1), the code can’t find anything under edu.wpi.first.wpilibj. I followed the instructions perfectly (I think). Any idea what might be causing this?

1 Like

The lines below should not be in build.gradle:

configurations.all {
    exclude group: "edu.wpi.first.wpilibj"
}

There are several other important changes to build.gradle in 4.0.0-beta-1. Our recommendation is to start with the skeleton template project and copy code from previous projects, which will minimize the chance of errors like this.

1 Like

I tried removing that and it just gives me a different error:

Error at org.littletonrobotics.junction.LoggedRobot.<init>(LoggedRobot.java:59): Unhandled exception instantiating robot edu.wpi.first.wpilibj.DSControlWord java.lang.NoSuchMethodError: 'org.littletonrobotics.junction.inputs.LoggedDriverStation$DriverStationInputs org.littletonrobotics.junction.inputs.LoggedDriverStation.getDSData()'

My team has a lot of other changes that I’d prefer not to mess with. Is there anything else that isn’t written in the docs that is important?

There are significant problems with your installation, because it’s still using parts of previous versions of AdvantageKit. You will get the smoothest experience by downloading the skeleton project and copying the src folder from the old project (along with any non-AdvantageKit changes to build.gradle). Otherwise, the installation instructions include everything you need to know to install AdvantageKit in a project that does not currently include it.

We have some minor changes from the default stuff from your skeleton project but everything looks like it should still work. I tried copying over the build.gradle file and re-adding our custom library and it’s still crashing with the same error

Can you link to a copy of your code? I’m not clear on exactly what you’re doing.

Absolutely, here it is GitHub - Programming-TRIGON/RobotTemplate at update-advantage-kit

It occured to me that the problem is most likely in our library here
I tried to update it and it seems to be working, but it says that Logger.recordOutput() doesn’t have a parameter for a Mechanism2d. Is this true?

Edit: I remember a change to how Mechanism2d is logged and that part is probably fine

Even after updating the library, the template doesn’t run with the exact same error

The robot program launches correctly when using the version of the library built with AdvantageKit 4.0.0-beta-1 (on the update-advantage-kit branch of the library repo). The problem was that the older version of the library was pulling in dependencies for the wrong version of AdvantageKit and interfering with the robot project.

Weird how it didn’t work for me when I tried it, but it’s working now. Thanks so much for the help