Trouble installing NavX library on mac

I’ve been trying to install the NavX library on a mac for java but so far I’ve had no luck with either online or offline installation. I’ve tried installing both the 2020 and 2019 release, but I get similar errors for both. These are the errors I get when trying an online installation for the 2020 release after rebuilding with gradle:

> Executing task: ./gradlew build   -Dorg.gradle.java.home="/Users/amorygalili/wpilib/2020/jdk" <


FAILURE: Build failed with an exception.

* Where:
Build file '/Users/amorygalili/Projects/robotics/navx-test3/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 resolve com.kauailabs.navx.frc:navx-java:3.1.409.
     Required by:
         project :
      > Could not resolve com.kauailabs.navx.frc:navx-java:3.1.409.
         > Could not get resource 'https://frcmaven.wpi.edu/artifactory/release/com/kauailabs/navx/frc/navx-java/3.1.409/navx-java-3.1.409.pom'.
            > Could not GET 'https://frcmaven.wpi.edu/artifactory/release/com/kauailabs/navx/frc/navx-java/3.1.409/navx-java-3.1.409.pom'.
               > Could not generate ECDH keypair
      > Could not resolve com.kauailabs.navx.frc:navx-java:3.1.409.
         > Could not get resource 'https://repo1.maven.org/maven2/com/kauailabs/navx/frc/navx-java/3.1.409/navx-java-3.1.409.pom'.
            > Could not GET 'https://repo1.maven.org/maven2/com/kauailabs/navx/frc/navx-java/3.1.409/navx-java-3.1.409.pom'.
               > Could not generate ECDH keypair
      > Could not resolve com.kauailabs.navx.frc:navx-java:3.1.409.
         > Could not get resource 'https://repo.maven.apache.org/maven2/com/kauailabs/navx/frc/navx-java/3.1.409/navx-java-3.1.409.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/com/kauailabs/navx/frc/navx-java/3.1.409/navx-java-3.1.409.pom'.
               > Could not generate ECDH keypair

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

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

I used this vendor file URL for online installation: https://www.kauailabs.com/dist/frc/2020/navx_frc.json

Has anyone run into similar problems? Here’s the project I was trying to install the navx library in, although I don’t know if it will contain any useful information since I just generated it with the wpilib vs code extension:

navx-test3.zip (19.2 MB)

Did you follow the directions here? Java | navX-MXP

Specifically, download this and follow the “offline” directions

If developing in a Linux or MacOS platform, you can download the cross-platform library package

Yup, I followed the offline instructions and installed the cross-platform library package. I tried a few things with it but it’s not clear to me what I’m supposed to do with the folder once it’s unzipped:

I’m not sure what I’m supposed to do here. I’m assuming I’m supposed to put some of these files in the ~/wpilib/2020/maven/com/ folder, but which ones? the src/com/kauailabs just contains src files and no .jar files. The lib folder contains .jar files, but doesn’t it need a .pom file to make it build properly? I also tried following the readme.txt file which said to drop the contents in the ~\navx-mxp folder, but that didn’t seem to work either. I installed the navx software successfully on a windows machine, which has a C:\Users\Public\wpilib\2020\maven\com\kauailabs\ folder with the navx software as well as the navx-mxp folder in the C:\Users\2423 Kwarqs\ location. Do I need both folders for mac development?

I’m unsure if this thread would help, but it looks useful.

The “cross platform library package” would not work because it does not follow the maven structure. Going back to your first post, I think that the key of the problem is this: “Could not generate ECDH keypair”. It looks like the SSL connection between your computer and the Maven Central server has failed, and that’s why it cannot find the library. I can access it with a web browser at https://repo1.maven.org/maven2/com/kauailabs/navx/frc/navx-java/3.1.409/, so it’s definitely there. I would check that you are using the correct java version to run Gradle, and maybe try a different version.

An alternative solution is to just copy the java files into your robot code itself. The navx library does not have a native dependency so this is relatively easy.

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