Need help with Java error "Task :downloadDepsPreemptively FAILED"

Hey, the programmers on team 6323 have been struggling with this error for a while. Some people will get it others will not.

Here is the error:

Executing task: gradlew deploy -PteamNumber=6323 --offline -Dorg.gradle.java.home=“C:\Users\Public\frc2019\jdk” <

Task :downloadDepsPreemptively FAILED

Task :discoverRoborio
Discovering Target roborio
Using [email protected]:22 for target roborio

FAILURE: Build failed with an exception.

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

Could not resolve all dependencies for configuration ‘:nativeZip’.
Could not resolve edu.wpi.first.hal:hal-cpp:2019.2.1.
Required by:
project :
No cached version of edu.wpi.first.hal:hal-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.hal:hal-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.hal:hal-cpp:2019.2.1 available for offline mode.
Could not resolve edu.wpi.first.wpiutil:wpiutil-cpp:2019.2.1.
Required by:
project :
No cached version of edu.wpi.first.wpiutil:wpiutil-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.wpiutil:wpiutil-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.wpiutil:wpiutil-cpp:2019.2.1 available for offline mode.
Could not resolve edu.wpi.first.ntcore:ntcore-cpp:2019.2.1.
Required by:
project :
No cached version of edu.wpi.first.ntcore:ntcore-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.ntcore:ntcore-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.ntcore:ntcore-cpp:2019.2.1 available for offline mode.
Could not resolve edu.wpi.first.cscore:cscore-cpp:2019.2.1.
Required by:
project :
No cached version of edu.wpi.first.cscore:cscore-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.cscore:cscore-cpp:2019.2.1 available for offline mode.
No cached version of edu.wpi.first.cscore:cscore-cpp:2019.2.1 available for offline mode.

  • 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

BUILD FAILED in 1s
3 actionable tasks: 2 executed, 1 up-to-date
The terminal process terminated with exit code: 1

I have tried to uninstall and reinstall many times to no avail. Any help would be great thanks.

1 Like

Connect to the internet, run “./gradlew build”, then you can connect to the robot and deploy.

2 Likes

What @amrelk said (this can be run in vscode by doing a build rather than a deploy). How did you upgrade to 2019.2.1? Did you use the 2019.2.1 offline installer?

Had the same error connect to the roborio through the usb cable and internet through wifi so you have both connected then run build robot code and then deploy robot code it will install some stuff from the internet ( one time process only ) and then deploy the code and you should be good to go.

Best of luck
Shadi

When cloning a project, you must explicitly run a Build before deploying. If you don’t run an initial build. the deploy will fail, unless you used the offline installer. After the first build, this is not needed anymore.

Thank you for your help I will check your many solutions as soon as I have access to the robot again which should be Saturday. Thank you all very much.

All right thank you all for the help it turned out to be that I needed to run ./gradlew build while connected to the internet, not the robot. Thanks.

1 Like