GradleRIO using intellij for 2019

Hi,
so we are now working on updating to the 2019 GradleRIO version and we are having some difficulties:
Using the example in zip https://github.com/wpilibsuite/GradleRIO/releases Ver 2019.1.1
for Java, the build failed with the following exception:

Plugin [id: ‘edu.wpi.first.GradleRIO’, version: ‘2019.1.1’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Plugin Repositories (could not resolve plugin artifact
  • ‘edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2019.1.1’)
    Searched in the following repositories:
    • MavenLocal(file:/C:/Users/nimrod/.m2/repository)
    • Gradle Central Plugin Repository
    • frcHome(file:/C:/Users/Public/frc2019/maven/)

build.gradle (As is from the example with adding the id “idea” in plugins for IntelliJ):

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

def ROBOT_MAIN_CLASS = “frc.team0000.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’
}
}
}

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 4.
dependencies {
compile wpi.deps.wpilib()
compile wpi.deps.vendor.java()
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
testCompile ‘junit:junit:4.12’
}

// 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.compile.collect { it.isDirectory() ? it : zipTree(it) } }
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
}

wrapper {
gradleVersion = ‘5.0’
}

-We have the latest Update suite and the offline installer using
ScreenSteps Live steps and we are using the JDK 11 that was in it.
-We know that the official support is for VS Code, but we know we can use IntelliJ as the gradle build should be IDE-agnostic.

Thanks in advance!

Do you have an Internet connection? Using GradleRIO without VSCode probably requires an Internet comnection on first build to cache the dependencies.

Yep, tried to delete the .gradle folders(from project folder and user folder) and recache, the same error repeats.

Have you tried adding Maven Central as a repository? It would look something like this.

repositories {
    mavenCentral()
}

Can you run ./gradlew -version ? I think you’re using an older version of the wrapper that hasn’t been updated yet

Yes, and nothing, but adding it to settings.gradle does indicates (in the error) that it searched there and found nothing :confused:

Well its seems I can’t run any gradle commands as it’s just throwing the same error.

If it was not clear the line id “edu.wpi.first.GradleRIO” version “2019.1.1” in gradle.build is what causing the error and deleting the line only causing other errors.
It is worth mentioning though that we have experience with GradleRIO 2018, I think we are measing a new step for the 2019 version
`

Wait wait wait, it does work on another PC, what the hell am I missing here? :man_facepalming:

I suspect your project is caching the Gradle wrapper from an earlier version.

Ahhh seems that there is toggle button for “Offline mode” and of course it was on for no reason.

Wow how many hours I just wasted on that lol :weary:

Ammm seems that no I get another error:

Receiver class org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl does not define or inherit an implementation of the resolved method abstract getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier; of interface org.gradle.api.artifacts.component.ModuleComponentIdentifier.

I don’t have time to keep working on it today but if someone knows anything about this it would be helpful, thanks for your help guys!

Make sure you are using IntelliJ Idea 2018.3 or higher. Gradle 5.0 is incompatible with lower Idea versions and causes that error. (One of our students was running into it earlier.)

Ow seems like it would be our problem too so we will definitely update IntelliJ, thanks!

And one more question, if I want to use an old project I have to copy his java files into a new 2019 project or can I update the gradle stuff in it? I think that I read somewhere that you have to start fresh(?)

Yes, you have to start fresh if you used GradleRIO previously. There’s an importer available in vscode for old Eclipse projects, but not one for old GradleRIO projects.

I would recommend starting fresh as there are some differences in the gradle.build and settings.gradle between the versions. If that’s really a pain, at least bring in the 2019.1.1 default versions of those (then modify them as needed), wipe your project .gradle and gradle directories and rebuild.