Could Not instantiate Robot

  • ********** Robot program starting **********

  • NT: server: client CONNECTED: 10.24.68.102 port 57972

  • Unhandled exception instantiating robot frc.robot2019.subsystems.CargoShooter java.lang.NullPointerException

  • Error at frc.robot2019.subsystems.CargoShooter.<init>(CargoShooter.java:60): Unhandled exception instantiating robot frc.robot2019.subsystems.CargoShooter java.lang.NullPointerException

  • at frc.robot2019.subsystems.CargoShooter.<init>(CargoShooter.java:60)

  • Robots should not quit, but yours did!

  • at frc.robot2019.subsystems.CargoShooter.getInstance(CargoShooter.java:32)

  • at frc.robot2019.Robot.<init>(Robot.java:43)

  • at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:221)

  • at frc.robot2019.Main.main(Main.java:27)

  • Warning at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:234): Robots should not quit, but yours did!

  • Could not instantiate robot frc.robot2019.subsystems.CargoShooter!

  • Error at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:235): Could not instantiate robot frc.robot2019.subsystems.CargoShooter!

  • [phoenix] Shutdown cleanly

What would the issue be with subsystems not instancing usually? I’ve gone through other threads, and this hasn’t been like the others. This is a subsystem issue, so how are these usually solved?

What’s on CargoShooter.java line 60? does it happen to have an object which is referenced before being instantiated with new ?

Here’s some good stackoverflow posts that explain Null Pointer Exceptions and debugging them with the provided Stack Trace

Yes, that was it. Thank you very much!