No Robot Code

Yesterday morning everything with our robot code was working fine, then it stopped working. The RoboRIO is giving us a red Comm light which means it is connected but there is no robot code. We tried replacing the RoboRio, but that didn’t work. I re-imaged the RoboRIO, re-uploaded the correct java 8 version, and all the firmware is up to date. Robot code builds and deploys successfully by the DS still says no code. I tried commenting out autonomous, camera, gyro and smarthDashboard code but came to no success. I also searched online and tried the joystick in port 5 trick and all my eclipse is up to date but still no Robot code. I also tired creating a small one motor command-based robot project but that did not work either. Additionally I tried editing the build properties themselves but to no avail. The only thing that seems to work and I get a green light for is the getting-started default code. I wanna be able to get my complex code up and running ASAP.

This was happening to us, and I finally figured out our problem, maybe this can help you.

First, if you are not seeing the console output, use the rioLog plugin
https://wpilib.screenstepslive.com/s/4485/m/13809/l/284333?data-resolve-url=true&data-manual-id=13809

We saw these messages:
ž” Launching «’/usr/local/frc/JRE/bin/java’ ‘-jar’ '/home/lvuser/FRCUserProgram.jar’»
Error at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:206): ERROR Unhandled exception instantiating robot org.usfirst.frc.team192.robot.Robot java.lang.ClassNotFoundException: org.usfirst.frc.team192.robot.Robot at java.net.URLClassLoader$1.run(URLClassLoader.java:372), java.net.URLClassLoader$1.run(URLClassLoader.java:361), java.security.AccessController.doPrivileged(Native Method), java.net.URLClassLoader.findClass(URLClassLoader.java:360), java.lang.ClassLoader.loadClass(ClassLoader.java:424), sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308), java.lang.ClassLoader.loadClass(ClassLoader.java:357)

This was a clue for us, because 192 was our prototype robot. Even though the package for our final robot was 191, I forgot to change it in the build.properties file, which looks like this:

Project specific information

package=org.usfirst.frc.team192.robot
robot.class=${package}.Robot
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
#Uncomment and point at user libraries to include them in the build. Do not put libraries in the \wpilib\java folder, this folder is completely overwritten on plugin update.
#userLibs=${user.home}/wpilib/user/lib

I changed the 192 to 191 and voila, robot code.

I am betting that you are getting a runtime exception that is crashing your program; this results in “No Robot Code” on the Driver Station. In the Riolog (in Eclipse), is there an error message that prints? If so, try reading the stack trace that you see there and find the error. If you don’t find an error in the Riolog or have trouble locating the problem after reading the stack trace, can you post your code? It will help us help you.