Getting "class frc.robot.Robot cannot inherit from final class" error code hlp

im trying to run a robot code its running in sim but on the roborio it doesn’t work and im getting this error pls help

I believe your problem is that you have a class that is set to final that shouldn’t be.

This is possible.

OP, the best way to prove or disprove this is if you are able to post your code (either here if it’s just one or two files, or github if it’s a larger set of files).

Alternatively, if you’d like to run experiments yourself - design an experiment which splits the problem space in half.

For example, make a brand new robot project with no modifications to code, deploy it, and see if it runs.

If it runs fine, you can conclude the problem exists in your own code. Start to compare your broken code to the working one to find any and all difference which could be causing the lack of functionality.

However, if a brand new unmodified project does not run fine, start looking for things specific to your roboRIO or deploy setup. Usually this starts by reimaging the RIO and trying again. It might require some deeper debugging.

Again though, given the symptom, it is likely something inside your code.


I dont know what it is but when i changed it from timedrobot to 6328’s loggedrobot it works

And a prior commit worked and i cant find somthing that might be the problem that was changed since than but also there were a lot of changes becuse we didnt hace the robot to test the code for sometime so we did a lot of stuff

Ok. It doesn’t appear much learning has occurred. It’s not clear to me if you need additional help.

If you’re looking for additional input, posting code with notes about which points in history you’re referring to would be necessary.

Alternatively, If you’re happy with where you’re at for now, fair enough. Best of luck in all your future endeavors!

It’s very helpful to identify that you’re using AdvantageKit up front. Since AdvantageKit overrides certain WPILib functionality you can get different behavior, as seen in this case.

Looking at the TimedRobot class in AdvantageKit, we see this:

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