Cannot install Photon vendor library

Hello,
This issue may be similar to others I have had, but I feel it is different enough to warrant a new post. I apologize if I am wrong with that.

I am trying to use the Photon simulator object described here.

However, I cannot get the vendor libraries to work. Here is the error I see.

Could not resolve all files for configuration ':runtimeClasspath'.
   > Could not find org.photonvision:PhotonTargeting-java:v2021.1.5-4-g00b8e7d1.
     Searched in the following locations:
       - file:/C:/.../wpilib/2021/maven/org/photonvision/PhotonTargeting-java/v2021.1.5-4-g00b8e7d1/PhotonTargeting-java-v2021.1.5-4-g00b8e7d1.pom       
       - https://frcmaven.wpi.edu/artifactory/release/org/photonvision/PhotonTargeting-java/v2021.1.5-4-g00b8e7d1/PhotonTargeting-java-v2021.1.5-4-g00b8e7d1.pom  
       - https://maven.photonvision.org/repository/internal/org/photonvision/PhotonTargeting-java/v2021.1.5-4-g00b8e7d1/PhotonTargeting-java-v2021.1.5-4-g00b8e7d1.pom
       - https://maven.photonvision.org/repository/snapshots/org/photonvision/PhotonTargeting-java/v2021.1.5-4-g00b8e7d1/PhotonTargeting-java-v2021.1.5-4-g00b8e7d1.pom
       - https://repo.maven.apache.org/maven2/org/photonvision/PhotonTargeting-java/v2021.1.5-4-g00b8e7d1/PhotonTargeting-java-v2021.1.5-4-g00b8e7d1.pom
     Required by:
         project :

* 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

I also tried running the code from the example libraries, but I cannot figure out how to make them work (which folder should be top-level for the build.gradle to function correctly).

1 Like

Can you try entering the listed URLs (in a browser) to see if the artifacts are still up?

1 Like

Thank you for the reply. I tried the last url, and it did not load correctly. However, I remembered (from one of my other issues), that the beta is not building on Windows.
So, I tried this Vendor dep file and built it while connected to the Internet, and it seems to work (it builds and runs the simulator perfectly).

{
    "fileName": "photonlib.json",
    "name": "photonlib",
    "version": "2021.1.2",
    "uuid": "********************************",
    "mavenUrls": [
        "https://maven.photonvision.org/repository/internal"
    ],
    "jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/lib/PhotonLib-json/1.0/PhotonLib-json-1.0.json",
    "jniDependencies": [],
    "cppDependencies": [
        {
            "groupId": "org.photonvision.lib",
            "artifactId": "PhotonLib-cpp",
            "version": "2021.1.2",
            "libName": "Photon",
            "headerClassifier": "headers",
            "sharedLibrary": true,
            "skipInvalidPlatforms": true,
            "binaryPlatforms": [
                "windowsx86-64",
                "linuxathena",
                "linuxx86-64",
                "osxx86-64"
            ]
        }
    ],
    "javaDependencies": [
        {
            "groupId": "org.photonvision.lib",
            "artifactId": "PhotonLib-java",
            "version": "2021.1.2"
        }
    ]
}

Edit: Actually, all of the urls gave 404 errors. So, I guess that would explain it. Thank you again for your help.

Happy to be of help.

1 Like

I just had a few more moments to poke around, and it totally works. I am currently using the sample code from Photon’s repo. It is working perfectly out of the box. We drive a bit, press the button, and the robot moves to the desired range while lining up. This really is a helpful tool.

2 Likes

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