PhotonLib "this.fieldTags is null" error

This is the full error:

Unhandled exception: java.lang.NullPointerException: Cannot invoke "edu.wpi.first.apriltag.AprilTagFieldLayout.getTagPose(int)" because "this.fieldTags" is null

We changed our apriltag layout in the code to the 2024 layout and switched our family to 36h11.

Our photonlib.json:

{
    "fileName": "photonlib.json",
    "name": "photonlib",
    "version": "v2023.4.2",
    "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004",
    "frcYear": "2024",
    "mavenUrls": [
        "https://maven.photonvision.org/repository/internal",
        "https://maven.photonvision.org/repository/snapshots"
    ],
    "jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/PhotonLib-json/1.0/PhotonLib-json-1.0.json",
    "jniDependencies": [],
    "cppDependencies": [
        {
            "groupId": "org.photonvision",
            "artifactId": "PhotonLib-cpp",
            "version": "v2023.4.2",
            "libName": "Photon",
            "headerClassifier": "headers",
            "sharedLibrary": true,
            "skipInvalidPlatforms": true,
            "binaryPlatforms": [
                "windowsx86-64",
                "linuxathena",
                "linuxx86-64",
                "osxuniversal"
            ]
        }
    ],
    "javaDependencies": [
        {
            "groupId": "org.photonvision",
            "artifactId": "PhotonLib-java",
            "version": "v2023.4.2"
        },
        {
            "groupId": "org.photonvision",
            "artifactId": "PhotonTargeting-java",
            "version": "v2023.4.2"
        }
    ]
}

The PhotonVision dashboard shows our version as v2023.4.2 same as the photonlib.json.

1 Like

Bad things happen when you modify the vendordep to try to work with 2024 wpilib instead of using the 2024 version of PhotonVision.

3 Likes

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