Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings

Hello! This is the error I have received when we launched our robot code:

Executing task: gradlew build -Dorg.gradle.java.home=“C:\Users\Public\wpilib\2020\jdk” <

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\POBots\Documents\Team353\Color-Sensor-v3-Examples-master\Java\Color Match\build.gradle’ line: 66

  • What went wrong:
    Could not determine the dependencies of task ‘:jar’.

Could not resolve all files for configuration ‘:runtimeClasspath’.
Could not find com.revrobotics.frc:ColorSensorV3-java:1.0.0.
Searched in the following locations:
- file:/C:/Users/Public/wpilib/2020/maven/com/revrobotics/frc/ColorSensorV3-java/1.0.0/ColorSensorV3-java-1.0.0.pom
- Required by:
project :

  • 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.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

We would appreciate if we could get help with what went wrong

Have you installed the REV color sensor library? If not, if you are using VSCode, try right clicking on build.gradle, selecting “Manage Vendor Libraries”, then “Install new libraries (online)” and providing this URL: http://revrobotics.com/content/sw/color-sensor-v3/sdk/REVColorSensorV3.json.

1 Like

I’m not 100% sure this is the right solution for your problem, but REV’s color sensor has an required SDK. https://docs.wpilib.org/en/latest/docs/software/wpilib-overview/3rd-party-libraries.html has some information and their product page has an SDK download https://www.revrobotics.com/rev-31-1557/ (I think you should only need that for offline install).

Yes, I did install the color sensor library but we are still receiving this error message

Can you see the REV color sensor json file in the vendordeps folder? If so, could you post you build.gradle file?

plugins {
id “java”
id “edu.wpi.first.GradleRIO” version “2020.1.2”
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

def ROBOT_MAIN_CLASS = “frc.robot.Main”

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO’s backing project EmbeddedTools.
deploy {
targets {
roboRIO(“roborio”) {
// Team number is loaded either from the .wpilib/wpilib_preferences.json
// or from command line. If not found an exception will be thrown.
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
// want to store a team number in this file.
team = frc.getTeamNumber()
}
}
artifacts {
frcJavaArtifact(‘frcJava’) {
targets << “roborio”
// Debug can be overridden by command line, for use with VSCode
debug = frc.getDebugOrDefault(false)
}
// Built in artifact to deploy arbitrary files to the roboRIO.
fileTreeArtifact(‘frcStaticFileDeploy’) {
// The directory below is the local directory to deploy
files = fileTree(dir: ‘src/main/deploy’)
// Deploy to RoboRIO target, into /home/lvuser/deploy
targets << “roborio”
directory = ‘/home/lvuser/deploy’
}
}
}

// Set this to true to enable desktop support.
def includeDesktopSupport = false

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 4.
dependencies {
implementation wpi.deps.wpilib()
nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio)
nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop)

implementation wpi.deps.vendor.java()
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)

testImplementation 'junit:junit:4.12'

// Enable simulation gui support. Must check the box in vscode to enable support
// upon debugging
simulation wpi.deps.sim.gui(wpi.platforms.desktop, false)

}

// Setting up my Jar File. In this case, adding all libraries into the main jar (‘fat jar’)
// in order to make them all available at runtime. Also adding the manifest so WPILib
// knows where to look for our Robot Class.
jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
}
This is the build.gradle code

That all looks good to me, not sure what your issue is. One thing I might try is doing ./gradlew clean and then try building again.

Are you on a computer with an active internet connection? My understanding is that if you don’t have it in your local maven repository, it’ll search online. Not having an internet connection means it won’t be able to fetch it.

I fixed the problem by using the wpilib importer
https://docs.wpilib.org/en/latest/docs/software/wpilib-overview/importing-gradle-project.html

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