Unsatisfied link error in cameraserver

We recently started having unsatisfied link errors with the wpilib cameraserver class:

>  java.lang.UnsatisfiedLinkError: 'int edu.wpi.cscore.CameraServerJNI.createListenerPoller()'
> <1>05:03:26:905 robot: 	at edu.wpi.cscore.CameraServerJNI.createListenerPoller(Native Method)
> <1>05:03:26:909 robot: 	at edu.wpi.cscore.VideoListener.<init>(VideoListener.java:30)
> <1>05:03:26:914 robot: 	at edu.wpi.first.cameraserver.CameraServer.<init>(CameraServer.java:335)
> <1>05:03:26:918 robot: 	at edu.wpi.first.cameraserver.CameraServer.getInstance(CameraServer.java:49)

As this was working fine I assume an update of some sort downloaded by Gradle has changed things…

What version of wpilib is listed in your build.gradle?

@Thad_House has talked about this issue a few times on the FRC Discord. It’s some dependency issue with NavX (or other potentially other vendor libraries I guess) that requires you to upgrade WPILib to latest to fix. It’s supposed to be fixed in 2022.

I’ve had the same issue myself and a related issue with wpi-math.

Good question. Are you referring to:
id “edu.wpi.first.GradleRIO” version “2021.2.1” ?

There is no other version specification relating to wpilib in build.gradle. I’m not clear if the above is only for the gradlerio plugin or relates to wpilib.

Bump that to 2021.3.1 (the latest version), and things should work.

So I’m a bit confused. I visited the github repo for gradlerio and on the code page it says the latest release is 2019.2.1. But if you go to the releases page you see a number of releases after that point ending in 2021.3.1 as you indicated. Why is the latest release still pointing to a 2019 release?

Gradlerio releases page is not where new updates are released from. Allwpilib is where you want to look for what the newest version is. And there is 2021.3.1. gradlerio and allwpilib are always released together with matching versions.

1 Like

Ok, updated WpiLib fixed the problem. Thanks.