Everything to do with Rev Spark Max in our code is going wrong

Buckle your seatbelts ladies and gentlemen because were going for a ride. We are having trouble fixing errors in our code that have to do with the rev spark max motor controllers. We will start with the imports. Here are the two imports that throw errors:

Import com.revrobotics.CANSparkMax;
Import com.revrobotics.CANSparkMaxLowLevel;

From both of these, we get the error “The import com.revrobotics cannot be resolved Java(268435846)”

Next, in our robotInit(), we have the following lines:

CANSparkMax left1 = new CANSparkMax(10, CANSparkMaxLowLevel.MotorType.kBrushless);

CANSparkMax left2 = new CANSparkMax(11, CANSparkMaxLowLevel.MotorType.kBrushless);

CANSparkMax left3 = new CANSparkMax(12, CANSparkMaxLowLevel.MotorType.kBrushless);

CANSparkMax right1 = new CANSparkMax(13, CANSparkMaxLowLevel.MotorType.kBrushless);

CANSparkMax right2 = new CANSparkMax(14, CANSparkMaxLowLevel.MotorType.kBrushless);

CANSparkMax right3 = new CANSparkMax(15, CANSparkMaxLowLevel.MotorType.kBrushless);

Here, every instance of CANSparkMax and CANSparkMaxLowLevel has the error message “CANSparkMax (or CANSparkMaxLowLevel) cannot be resolved to a type”

Now when we build the code, we get the error message in the picture attached.

We thought this issue was the JAVA API wasn’t installed (the link http://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json). This however does nothing and we get the same error as before (image attached). We are out of ideas, our mentors are out of ideas, another teams mentors are out of ideas, and we have competition in 3 days. Any help would b

e greatly appreciated. Ask any questions you need and I’ll answer them to the best of my ability

There seems to be an issue on REV’s end with the latest .pom files for Gradle.

http://www.revrobotics.com/content/sw/max/sdk/maven/com/revrobotics/frc/SparkMax-java/1.5.2/SparkMax-java-1.5.2.pom is not available, but http://www.revrobotics.com/content/sw/max/sdk/maven/com/revrobotics/frc/SparkMax-java/1.5.1/SparkMax-java-1.5.1.pom is.

Try going into your vendordeps and manually changing 1.5.2 to 1.5.1.

1 Like

Do you mean going into the REVRobotics.json file and changing every 1.5.2 in the code to 1.5.1? Once I do that do I have to update anything in my motor controllers, code, or anything?

Yes, I don’t know if it will work, but that would be my first attempt. After that, make sure you build/deploy. The rest should be handled.

We get this error

Connect to the internet :slight_smile: then run “Build robot code”. After that you should be able to connect to the robot and deploy.

The internet as in my home routers wifi or the robots wifi

I would try to refresh dependencies via command line. Otherwise I would try to re-clone the repository and force gradlew to import changes.

Home routers wifi. Gradle (the program that retrieves a bunch of libraries that your robot code uses) will automatically download a bunch of files for you, but since you haven’t downloaded them yet, it needs to download them once before it can compile.

This is a one time step for each version of the library (whether it be for Spark MAXs, or the CTRE Phoenix library, etc); the files it downloads are saved on your laptop for you for future builds.

Sounds good. As soon as I get to some wifi I’ll get in it. To recap, I change all the 1.5.2 to 1.5.1, then build the code while connected to wifi?

Yep. After that completes you should be able to connect to your robot and deploy the code.

I’m not the most experienced of lads so I’ll have to ask for directions on how to do these things. Much appreciated

It worked. You have saved our souls. Thank you so much. If we come into any issues similar we will post.

2 Likes

As pointed out this was a maven publishing issue on our side impacting only Java for 1.5.2 and has now been fixed.

Another note is that this did not impact the offline version, which is more robust against things like lack of internet connection or server uptime. http://www.revrobotics.com/sparkmax-software/#java-api

1 Like

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