Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Simulator is not building #57

Open
katzuv opened this issue Jan 17, 2019 · 12 comments
Open

Simulator is not building #57

katzuv opened this issue Jan 17, 2019 · 12 comments

Comments

@katzuv
Copy link

katzuv commented Jan 17, 2019

Describe the bug
Describe the issue you are seeing with the simulator

Quick Glance Configuration
Please provide the following information

  1. SnobotSimPlugin version - 2019-0.2.0
  2. SnobotSim version - ?
  3. GradleRIO version - 2019.2.1
  4. Windows 10

To Reproduce
Please information on when the issue occurs, and/or what you did to cause the issue to surface. i.e.

  • Does the issue happen during compilation (gradlew build)? yes
  • Does the issue happen when simulating from the command line (gradlew runSnobotSim)? yes
  • Does the issue happen on startup (unsatisfied link, class not found, NPE, etc)? - cannot reach this setp
  • Does the issue happen while running (When we try to use a joystick..., when we put it in auton..., etc)? - cannot reach this setp

Expected behavior
The code will build

Detailed Setup

plugins {
    id "java"
    id "edu.wpi.first.GradleRIO" version "2019.2.1"
    // id "jaci.openrio.gradle.GradleRIO" version "2018.01.06"// Should point to the at https://login.gradle.org/plugin/jaci.openrio.gradle.GradleRIO
    id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2019-0.2.0" apply false
}

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
apply plugin: com.snobot.simulator.plugin.SnobotSimulatorPlugin
configurations {
    snobotSimCompile
}
// Maven central needed for JUnit
repositories {
    mavenCentral()
}

// 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'

    testCompile snobotSimCompile()
    testCompile snobotSimJavaCompile()
}

// 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)
}

Stacktrace:

.\gradlew build --stacktrace

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Reali\Desktop\test\eya\build.gradle' line: 62

* What went wrong:
A problem occurred evaluating root project 'eya'.
> Could not find method snobotSimCompile() for arguments [] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'eya'.
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:206)
        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:211)
        at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)
        at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:48)
        at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)
        at org.gradle.configuration.project.BuildScriptProcessor$1.run(BuildScriptProcessor.java:44)
        at org.gradle.internal.Factories$1.create(Factories.java:25)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:200)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:186)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:41)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
        at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:107)
        at org.gradle.internal.Factories$1.create(Factories.java:25)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:226)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:220)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:186)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:96)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:68)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:687)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:140)
        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:60)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:41)
        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:286)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:194)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:133)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:79)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:76)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:103)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:96)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:96)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:76)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:49)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:44)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:79)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method snobotSimCompile() for arguments [] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
        at org.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:179)
        at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:87)
        at build_4vhn2o0fs69ybkmiy1hisreg8$_run_closure4.doCall(C:\Users\Reali\Desktop\test\eya\build.gradle:62)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:70)
        at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:105)
        at org.gradle.api.internal.project.DefaultProject.dependencies(DefaultProject.java:1182)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:479)
        at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191)
        at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.java:98)
        at org.gradle.internal.metaobject.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:30)
        at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:133)
        at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:160)
        at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:82)
        at build_4vhn2o0fs69ybkmiy1hisreg8.run(C:\Users\Reali\Desktop\test\eya\build.gradle:55)
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
        ... 115 more


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

Why is the simulator not building?
Thanks a lot!

@pjreiniger
Copy link
Collaborator

Poor/outdated documentation, Sorry about that. Your dependency block should probably look something like this:

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'

    // SnobotSim
    snobotSimCompile snobotSimJava()
}

I would always check the examples for the recommended layout. I use those to test the simulator before a release, and release updates to both at the same time, so that is pretty much guaranteed to be up to date. I can get lax on the wiki page.

This is probably the best one to look at

@WWRC-FRC
Copy link

WWRC-FRC commented Mar 1, 2019

I am having similar issues building. I can't even build the examples, so obviously something wrong with my setup and not the files themselves.
I have cloned the examples, opened, for example "JavaWithVendorLibraries" then execute wpilib:Simulate robot code on desktop. The build starts but eventually fails with the following error...

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\a0212178\Desktop\WW\FRC2019\RobotCode\SnobotSimExamples\JavaWithVendorLibraries\build.gradle' line: 4

  • What went wrong:
    Plugin [id: 'com.snobot.simulator.plugin.SnobotSimulatorPlugin', version: '2019-0.2.0', apply: false] 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 'com.snobot.simulator.plugin.SnobotSimulatorPlugin:com.snobot.simulator.plugin.SnobotSimulatorPlugin.gradle.plugin:2019-0.2.0')
    Searched in the following repositories:
    MavenLocal(file:/C:/Users/a0212178/.m2/repository)
    Gradle Central Plugin Repository
    frcHome(file:/C:/Users/Public/frc2019/maven/)

Any thoughts/ideas where to start?

BR,
Steve

@SteveDC2
Copy link

SteveDC2 commented Mar 4, 2019

OK, done a completely clean install of VSCode to try to address some other issues and tried this again.
Cloned Snobot from git, opened the Snobot folder in VS Code, selected build robot code but get the following error...

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\a0212178\Desktop\WW\FRC2019\RobotCode\SnobotSim\build.gradle' line: 20

  • What went wrong:
    Plugin [id: 'net.ltgt.errorprone', version: '0.6', apply: false] 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 'net.ltgt.errorprone:net.ltgt.errorprone.gradle.plugin:0.6')
    Searched in the following repositories:
    Gradle Central Plugin Repository

Any thoughts please?

BR,
Steve

@pjreiniger
Copy link
Collaborator

pjreiniger commented Mar 4, 2019

@WWRC-FRC You should be using a newer plugin. I might not have updated the examples, I've been on work travel forever. Here are some recommended settings

plugins {
    id "java"
    id "idea"
    id "eclipse"
    id "jacoco"
    id "edu.wpi.first.GradleRIO" version "2019.4.1"
    id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2019-2.0.0" apply false
}

If you are using REV SparkMax's, you will need to add this in

/////////////////////////////////////////////////////
// Snobot Sim
apply plugin: com.snobot.simulator.plugin.SnobotSimulatorPlugin

snobotSim {
    snobotSimRevVersion = "1.1.8_V0"
    snobotSimVersion = "2019-1.2.0"
}
// End Snobot Sim
/////////////////////////////////////////////////////

And in your dependencies block (which hasn't changed in 2019)

    // SnobotSim
    snobotSimCompile snobotSimJava()

This may or may not be closed source at the moment. I don't think I have the permissions to open it up, but here is what my team has https://gitlab.com/XCats/Software/software-2019/blob/dev/DeepSpace2019/build.gradle

@SteveDC2
Copy link

SteveDC2 commented Mar 4, 2019

First, Thanks for the response. Very much appreciated :) Work can often get in the way !!!
Looking at your examples, e.g. JavaCommandBased the plugins section contains the following...
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2019.4.1"
id "com.snobot.simulator.plugin.SnobotSimulatorPlugin" version "2019-0.2.0" apply false
}

We are not using SparkMax, but I added it just as a test.
The dependencies are already there too.
After adding the SparkMax and building JavaCommandBased I still get the same error :(
Whilst I have been programming for 40+ years I am not too familiar with Java or Gradle etc... so most of this framework setup is new to me and I have likely (obviously) missed something along the way.
As a final test I cloned your team code and STILL get the same error when I try to build robot code, so obviously I am missing some configuration or setup step :(
What went wrong:
Plugin [id: 'com.snobot.simulator.plugin.SnobotSimulatorPlugin', version: '2019-2.0.0', apply: false]
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 'com.snobot.simulator.plugin.SnobotSimulatorPlugin:com.snobot.simulator.plugin.SnobotSimulatorPlugin.gradle.plugin:2019-2.0.0')
    Searched in the following repositories:
    MavenLocal(file:/C:/Users/a0212178/.m2/repository)
    Gradle Central Plugin Repository
    frcHome(file:/C:/Users/Public/frc2019/maven/)

@pjreiniger
Copy link
Collaborator

pjreiniger commented Mar 4, 2019

Sanity checks:

  • Are you online?
  • Are you using gradle 5.0? (If you are using this to deploy to the robot I feel like you have to be)

That seems like a weird error, is that what is coming directly from the console? If not could you post that and put it in a code/quote block?

I just checked the plugin, the gradle website is showing that 2019.2.0.0 is there and is the latest https://plugins.gradle.org/plugin/com.snobot.simulator.plugin.SnobotSimulatorPlugin

If your code is open source and on github/gitlab I can take a look at the build file and structure to see if anything jumps out

@SteveDC2
Copy link

SteveDC2 commented Mar 4, 2019

Online, yes, but company firewall might be causing issues, although I can access "https://plugins.gradle.org/plugin/com.snobot.simulator.plugin.SnobotSimulatorPlugin" from a browser so don't think it is blocked.
The error message is copied and pasted directly from the terminal window.
Regarding code, I can't even get either your examples nor your team code to build, so I don't think it is a code issue per-se. I figured if I can't get your code/examples working then I have bigger issues :)
Regarding Gradle version... not 100% sure, but just gone through a completely clean install on this computer so expect I have the latest. How do I check? (As I said, virtually zero experience with the frameworks)
I will try to duplicate the issue at home tonight but I think the issue is computer specific anyhow. I just can't seem to work out what I have missed on this computer :(
Are there any logs that might be helpful and/or provide more details on what is/is not going on?
Finally, again I really appreciate you taking the time to respond :)

Here is the terminal message in its entirety...

Executing task: gradlew build -Dorg.gradle.java.home="C:\Users\Public\frc2019\jdk" <

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\a0212178\Desktop\WW\FRC2019\RobotCode\software-2019\DeepSpace2019\build.gradle' line: 7

* What went wrong:
Plugin [id: 'com.snobot.simulator.plugin.SnobotSimulatorPlugin', version: '2019-2.0.0', apply: false]
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 'com.snobot.simulator.plugin.SnobotSimulatorPlugin:com.snobot.simulator.plugin.SnobotSimulatorPlugin.gradle.plugin:2019-2.0.0')
Searched in the following repositories:
MavenLocal(file:/C:/Users/a0212178/.m2/repository)
Gradle Central Plugin Repository
frcHome(file:/C:/Users/Public/frc2019/maven/)

* 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 10s
The terminal process terminated with exit code: 1

@pjreiniger
Copy link
Collaborator

pjreiniger commented Mar 5, 2019

Typically when I point to an invalid release, or am not online it dumps out the website addresses it tries to crawl rather than "Gradle Central Plugin Repository". Might be gradle version, might be because that is usually dependencies rather than plugins...

I would definitely try on a less locked down computer. I remember when Jaci was trying to set up GradleRIO and managing her own maven repo for CTRE/NavX stuff people were having trouble reaching a server in Australia. I can tell you that the (somewhate outdated) examples build with a CI tool (minus the ever broken C++ simulations), as does my teams code.

There are probably better ways to check the gradle version, but the quick and dirty way I typically do is look at <project_root>/gradle\wrapper\gradle-wrapper.properties

@WWRC-FRC
Copy link

WWRC-FRC commented Mar 5, 2019

So, here at home I can build everything and the simulations seem to run fine on my home computer:)
The issue is (as expected) something specific about my work computer, which unfortunately is the one I would really prefer to work on.
Do you know if there is a way to offline install everything necessary since I assume that once installed I shouldn't need a connection to anything afterwards. My concern is that the school connection may also block something necessary.
I might have to try bringing my work laptop home and temporarily bypassing the DNS rules to see if I can get things to build that way.
I just now need to work out how to connect with driver station :)
In VSCode I see a set of threads running including one called "FRCDriverStation" which is what I assume is trying to talk with the NI Driver Station, but NI Driver Station can't communicate with the simulated robot.
Time to carry on Googling :)
As always, your help and time are very much appreciated.

@WWRC-FRC
Copy link

WWRC-FRC commented Mar 5, 2019

Managed to get the simulator running with Driver Station at last :)
Still having an issue with what appears to be commands not running when joystick buttons are pressed but will need to check if this is a simulation issue or if something is actually wrong with our code.
I have been re-structuring a lot of things to hopefully make the code better structured and testable so not had chance to actually push to a robot yet, so I might have broken something.

@pjreiniger
Copy link
Collaborator

The simulator actually simulates the drive train. I experimented with using the WPI tool that would use the real driver station, but it wasn't ready by the start of the season.

You can tell the simulator what joysticks to use (including the ability to use the keyboard as a mock joystick)

@WWRC-FRC
Copy link

Thanks. Will look into that more.
Any pointers on configuring/using the simulation joystick?

BR,
Steve

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants