We’re suddenly getting this error in our code.
This part of the code:
SmartDashboard.getNumber("Base Drive Level ", 0)
Has this error:
The type edu.wpi.first.wpilibj.tables.TableKeyNotDefinedException cannot be resolved. It is indirectly referenced from required .class files
You’re using a library that uses the WPILib library. Yet the WPILlib specific library where that exception lives isn’t in the deployed environment.
i.e. your dependencies have dependencies, which you need to track down. For example, if you’ve just included the SmartDashboard jars into your local project and launching that from Eclipse, you’ll also need the WPILib specific jars included in the project.
IF you’d be up for it, GradleRIO does wonders for this type of thing. It manages dependencies internally. It’s relatively simple to learn, and plenty of people around here are willing to help! If (e.g.) you have a folder of jars you want included, I can help you with the Gradle config for that.
If you can do the setup on the command line, you can do the rest from Eclipse. GradleRIO recommends Windows users use PowerShell. Personally, I like the terminal provided by git-scm since it’s more Unix-centric. If you’d like I can walk you through some basics with the command line to get it setup.
My first question before starting is where do I put the Quickstart.zip? We are using Eclipse, so I’m thinking it goes in our workspace folder Users/username/eclipse-workspace
I unzipped the quickstart in the project folder, then imported the project. When I use terminal ‘./gradlew eclipse’ I get a permissions issue; I’m logged in as administrator.
That did it! I ran this on a small tank drive project that was on my laptop. I don’t have access to the code we were having that library error that started this thread as we ended our team meeting.
If I had, would this build process have inserted the necessary dependencies?
If we use this for builds, do we no longer care about importing libraries?
How do we see what Gradle did to the source code post build?
Keep forgetting to Thank You for all your help so far!
Gradle doesn’t change the source code - it compiles it.
You still have to import libraries, and tell gradle which dependencies to use, and how. GradleRIO (which is a plugin for gradle) does this for most FRC stuff. If you want to use a library GradleRIO does not include, you’ll have to add it to the build.gradle yourself. I would recommend taking a look at the build.gradle anyway, as it has some things which you might want to change (team, robot class, etc.) and is how you update plugins (GradleRIO) and dependencies.
The result of the compilation should be in /build/libs
If you want to see a real robot project using this, check out this - I ported my teams code to gradle(RIO) during the offseason (basically for fun; I’m not sure anyone on the team knows about it). It has both 2017 and 2018 beta branches, which you can compare to see how easy it is to update using gradle.
For more complex Gradle setups, checkout my team’s Github for 2017 & 2018 (link in the signature). We’re setting up 2018’s project structure now, and experimenting with a few potential code frameworks.