AdvantageKit AutoLog Annotation Build Error

I am developing hardware interfaces using AdvantageKit in Java. I am using the @AutoLog annotation to generate the LoggableInput classes at build time, and I am getting an error when trying to build. I have had these annotations in my robot project for the past month, and never gotten the error before. I don’t know what changed—this seems like a pretty low-level error, so I’m not sure if I caused the problem directly. The error is listed as “FilerException: Attempt to recreate a file for type frc.robot.”.
I have tried deleting the files in the “build” directory, but that did not fix the issue. Any help is appreciated.

The FilerException indicates AutoLog is trying to generate a file twice. Do you have another AutoLog annotation for another type with the same name “ModuleIOInputs”?

The issue is related to a change in GradleRIO that changed the behavior of annotation processors. You’ll need to add this line to .vscode/settings.json:

"java.import.gradle.annotationProcessing.enabled": false

This fix is included in the latest versions of the AdvantageKit template projects.

1 Like

Thanks—I realized I did have a duplicate class named “ModuleIOInputs” in a different file. Changing this, and added the setting that @jonahb55 mentioned, fixed my problem.

1 Like