Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generated RobotLogger encountering "cannot be resolved or is not a field" #20

Open
zeroClearAmerican opened this issue Nov 1, 2024 · 5 comments · Fixed by wpilibsuite/GradleRIO#759
Labels
bug Something isn't working Pending The issue will be fixed in the next release WPILib - Java

Comments

@zeroClearAmerican
Copy link

zeroClearAmerican commented Nov 1, 2024

Describe the bug
After converting our 2024 code to 2025, adding annotation logging, and resolving all build errors, attempts to run the robot code result in an error on program startup, stemming from the auto-generated Epilogue logger classes.

The code can be built successfully using the WPILib: Build robot code command, and the error seems like it would occur during the build and not at runtime, so it's perplexing.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command "WPILib: Simulate Robot Code"
  2. Note that the code builds without issue.
  3. Select "Sim GUI"
  4. Select "Continue" in the build failure notification.
  5. Watch Sim GUI startup and immediately shutdown
  6. Check Debug: Main terminal to see stack trace

Expected behavior
The robot code would be expected to start successfully and enter Disabled mode

Screenshots
Here is the stack trace of the error:

Error at frc.robot.RobotLogger.update(RobotLogger.java:29): Unhandled exception: java.lang.Error: Unresolved compilation problem: 
        containerLogger cannot be resolved or is not a field

        at frc.robot.RobotLogger.update(RobotLogger.java:29)
        at frc.robot.RobotLogger.update(RobotLogger.java:1)
        at edu.wpi.first.epilogue.logging.ClassSpecificLogger.tryUpdate(ClassSpecificLogger.java:64)
        at edu.wpi.first.epilogue.Epilogue.update(Epilogue.java:34)
        at edu.wpi.first.epilogue.Epilogue.lambda$0(Epilogue.java:55)
        at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:146)
        at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:350)
        at edu.wpi.first.wpilibj.RobotBase.lambda$startRobot$0(RobotBase.java:418)
        at java.base/java.lang.Thread.run(Unknown Source)

And a screenshot of the source:
Image

Desktop:

  • OS: Windows 10
  • OS Language: English
  • Project Information: WPILib Information:
    Project Version: 2025.1.1-beta-1
    VS Code Version: 1.94.2
    WPILib Extension Version: 2025.1.1-beta-1
    C++ Extension Version: 1.22.9
    Java Extension Version: 1.36.2024092708
    Java Debug Extension Version: 0.58.2024090204
    Java Dependencies Extension Version 0.24.0
    Java Version: 17
    Java Location: C:\Users\Public\wpilib\2025\jdk
    Vendor Libraries:
    PathplannerLib (2025.0.0-beta-3.1)
    CTRE-Phoenix (v5) (5.34.0-beta-1)
    CTRE-Phoenix (v6) (25.0.0-beta-1)
    REVLib (2024.2.4)
    WPILib-New-Commands (1.0.0)

roboRIO (please complete the following information if applicable):
(simulation)

Additional context
n/a

@rzblue
Copy link
Member

rzblue commented Nov 1, 2024

We are aware of this issue and are investigating more options to fix or work around this. See this comment for more info.

@zeroClearAmerican
Copy link
Author

Thanks for the update. Running gradlew simulateJava in the project's root directory is successfully starting the simulation for me.

@rzblue
Copy link
Member

rzblue commented Nov 12, 2024

Reopening until the issue is fixed in a release

@rzblue
Copy link
Member

rzblue commented Nov 21, 2024

Unfortunately, it appears that this can still happen on v2025.1.1-beta-2

@rzblue
Copy link
Member

rzblue commented Nov 22, 2024

We've identified a VSCode setting that appears to fix this in combination with the beta-2 fixes. Add the following to your project's .vscode/settings.json:

"java.import.gradle.annotationProcessing.enabled": false

The whole config should look something like this:

{
  "java.configuration.updateBuildConfiguration": "automatic",
  "java.server.launchMode": "Standard",
  "files.exclude": {
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "bin/": true,
    "**/.classpath": true,
    "**/.project": true,
    "**/.settings": true,
    "**/.factorypath": true,
    "**/*~": true
  },
  "java.test.config": [
    {
      "name": "WPIlibUnitTests",
      "workingDirectory": "${workspaceFolder}/build/jni/release",
      "vmargs": [ "-Djava.library.path=${workspaceFolder}/build/jni/release" ],
      "env": {
        "LD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" ,
        "DYLD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release"
      }
    },
  ],
  "java.test.defaultConfig": "WPIlibUnitTests",
  "java.import.gradle.annotationProcessing.enabled": false
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Pending The issue will be fixed in the next release WPILib - Java
Projects
None yet
2 participants