Problems with CTRE library - WPILib 2024

Hi!
We’re having problems when trying to use the CTRE libraries with WPILib 2024. When we try to build our code without the CTRE libraries it works but when we try to use it, this message appears:

The message doesn’t explain if the problem is the library but it only appears when we install it. We don’t have knowledge about gradle so we would aprreciate if someone explain it!

Make sure you are using the Phoenix 6 vendor dependency as well as phoenix 6 firmware for all of your ctre devices. If you are using Phoenix 6 everywhere, could you provide the entire error message (the message says to scroll up for more information)?

Here’s the error:

Scroll up. Theres almost certainly more to the message

There’s nothing more… It’s the only message that appears.

Try to run .\gradlew build --stacktrace, it should provide more info.

1 Like

These informations appeared: (we deleted the file for security reasons)

And with --debug?

Here (we deleted the file for security reasons)

The error is here in the log:

2024-01-12T15:38:27.400-0800 [ERROR] [org.gradle.internal.operations.logging.DefaultBuildOperationLoggerFactory] C:\Users\Public\Documents\ProgramaþÒo Crescendo V1\ProgramaþÒo Crescendo V1\src\main\cpp\Robot.cpp:14:10: fatal error: ctre/phoenix/motorcontrol/can/WPI_VictorSPX.h: No such file or directory
   14 | #include <ctre/phoenix/motorcontrol/can/WPI_VictorSPX.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

The reason you’re not getting useful error information from Gradle is because of the special characters in the path, which apparently aren’t output in UTF-8 and thus Java can’t parse it back in to output it. If you rename the folders that should fix Gradle outputting errors correctly.

The underlying problem is that it’s not finding the CTRE headers. Have you installed the CTRE 2024 vendor dep JSON in your project?

Looks like here’s the problem:

2024-01-12T15:38:27.400-0800 [ERROR] [org.gradle.internal.operations.logging.DefaultBuildOperationLoggerFactory] C:\Users\Public\Documents\ProgramaþÒo Crescendo V1\ProgramaþÒo Crescendo V1\src\main\cpp\Robot.cpp:14:10: fatal error: ctre/phoenix/motorcontrol/can/WPI_VictorSPX.h: No such file or directory
   14 | #include <ctre/phoenix/motorcontrol/can/WPI_VictorSPX.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Edit: sniped

We have the Phoenix Tuner X app and these offline libraries installed:
WhatsApp Image 2024-01-12 at 16.00.27
We have tried the online libraries too, but it shows the same error.

These CTRE vendor dep JSON that you’re saying is another step that we need to do? (we genuinely don’t know).

Do not recommend to share --debug logs. They can contain security sensitive info, including passwords in plain text.

2 Likes

Didn’t know that, note taken!

Yup. --info logs are fine, --debug logs are not.

2 Likes

We didn’t know that. Thank you for letting us know!

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