Having trouble using the WPIlib sim

Hello. So I acknowledge that I am a complete noob at using robot code sims in general so there may be some very basic thing that I’ve missed out on. However, when I attempt to execute gradlew simulateExternalJava I get the following error:

>gradlew simulateExternalJava

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

*Where:
Build file `F:\VictorSpxCAN\build.gradle` line: 49

*What went wrong:
A problem occured evaluating root project `VictorSpxCAN`
> No signature of method: edu.wpi.first.gradlewrio.wpi.dependencies.WPIDepsExtension.wpilibJni() is applicable for argument types: (String) values: [linuxathenal]

    Possible solutions: wpilibJni(), wpilib(), wpilibJars()
 

The dependencies section of my build.gradle file looks like this, based off of this tutorial:

dependencies {
    compile wpi.deps.wpilib()
    nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio)
    nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop)


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

    simulation wpi.deps.sim.gui(wpi.platforms.desktop, false)

    testCompile 'junit:junit:4.12'
}

For what its worth, I’m also using the Phoenix library. Is that what’s causing the issues? The error from the command prompt doesn’t seem to indicate so. This isn’t any code I’m planning on actually using for a robot, I just wrote up a short thing to simulate an Arcade Drive, so if that’s something I need to change its not a huge deal.

While I’m making a thread about simulating robot code, do any of you guys have any beginners pointers or tutorials you can point me to?

Thanks!

That tutorial is set up for the 2020 setup. Simulation is set up for the 2019 projects by default, but you will not have access to the new Sim GUI, as that only works with 2020.

So testing for now, you can just use your current 2019 project.

1 Like

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