Why can't I deploy my code to my robot

Hello. I am a beginner at programming and I am having problems with deploying my code to the robot. It builds successfully yet I cant deploy it. (using java)

The message that comes up in the end is:

Task :discoverRoborio
Discovering Target roborio
admin @ Resolved but not connected.
Reason: JSchException
socket is not established
admin @ Resolved but not connected.
Reason: JSchException
socket is not established
admin @ roborio-7137-FRC.local: Failed resolution.
Reason: TimeoutException
Discovery timed out.
admin @ roborio-7137-FRC: Failed resolution.
Reason: UnknownHostException
Not enough memory resources are available to process this command (roborio-7137-FRC)
admin @ roborio-7137-FRC.lan: Failed resolution.
Reason: UnknownHostException
No such host is known (roborio-7137-FRC.lan)
admin @ roborio-7137-FRC.frc-field.local: Failed resolution.
Reason: UnknownHostException
No such host is known (roborio-7137-FRC.frc-field.local)
admin @ null: Failed resolution.
Reason: UnknownHostException
No such host is known (ds_comms_failed.ds_not_connected_to_robot)
Run with --info for more details

Task :discoverRoborio FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:discoverRoborio’.

A failure occurred while executing jaci.gradle.deploy.target.discovery.TargetDiscoveryWorker
Target roborio could not be found at any location! See above for more details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

6 actionable tasks: 4 executed, 2 up-to-date
Missing Target!
Are you connected to the robot, and is it on?

GradleRIO detected this build failed due to not being able to find “roborio”!
Scroll up in this error log for more information.
The terminal process terminated with exit code: 1

I am connected to the robot and it is on so I don’t really know what is wrong. If anyone needs me to post the whole message I will gladly post it.
I would appreciate any advice given towards helping me to fix this problem. Thank you.

Please post the entire log. The specific error message is above what you posted.

What version is the image on the Rio, and what version of Wpilib are you running?

How are you connected to the robot, i.e. USB cable or radio?
Is the FRC Driver Station running, can it connect?

the version of the image on the Rio is v14 atleast thats the only that I can see that has anything to do with versions, the version of Wpilib I am running is (2019)2.1

I am connected through the radio and the FRC Driver Station is running. I can also connect to the radio yes

This is at least part of your problem, if you’re running Rio image v14. WPILib 2019.2.1 doesn’t support that image. You’ll need at least 2019.3.2.

1 Like

If you’re connected via the radio, your roborio should be available with an IP address of 10.TE.AM.2, like for team 7137.
From a command prompt, ping should show a response.
When you deploy code, it will try to connect in various ways, including
admin @ If it fails all connection attempts and admin @ is not on the list, check that the team number has been set via View, Command Palette, WPILib, Set Team Number.
If it can actually connect but then runs into a deployment error, the problem could indeed be related to version issues as mentioned above.

Would I have to uninstall the application of WPilib that I have and install a more recent version or is there a way where I can simply update it?

Just update.
Next time you then start VS Studio, it should prompt “Do you want to update …”.

To update, get it from https://github.com/wpilibsuite/allwpilib/releases/ , e.g. WPILibInstaller_Windows64-2019.4.1.zip


After the update, the build.gradle should contain the new version like

    id "edu.wpi.first.GradleRIO" version "2019.4.1"

If you don’t get the “Do you want to update” prompt, right-click on build.gradle, “manage Vendor Libraries”, “Check for updates (offline[!!])”, then select the new version that you just installed.

I have finally downloaded the version and the prompt that asked if I wanted to update to the newer version did come up and I clicked yes but it said something about running a build and I said yes to that which I don’t know what it is. I decided to continue anyways and checked for updates offline but it says “No updates available”. Am I supposed to run a build whatever it means by that in order to actually update it since I clicked yes on it?

It’s saying that you need to build your code for intellisense/completions to update, and is offering to build your code for you. You should be able to continue and deploy regardless of which option you selected.

I would build, check that you’re build.gradle has 2019.4.1 as the version, and try deploying to the bot.

Do I check in Manage Vendor Libraries to see if it has 2019.4.1? because if I do look in there there is nothing even though I successfully installed the 4.1 version

For some reason I still cannot deploy my code into the bot and it is for the same reason. It is as if it is still in the same version and nothing has changed. Also I don’t see the 4.1 version in vendor libraries

In the build.gradle file on line 3, it should read "id “edu.wpi.first.GradleRIO” version “2019.4.1"”. You do not have to check the Vendor Libraries, as that is only for libraries such as CTRE’s libraries. Verify that you have version 2019.4.1 on line 3 of build.gradle.

I have checked and it does indeed say id “edu.wpi.first.GradleRIO” version “2019.4.1”. I also see that the source and target compatibility say they are “JavaVersion.VERSION_11” I don’t know if that could be a part of the problem or not.

Nope, sounds good. Java version is just the version of the jdk you’re running. Run a build of your code, then try deploying.