I copied my 2022 robot program (which builds and deploys correctly) to a new folder for starting 2023 work. I changed the package statement in the code files to reflect the new program name. I have done this before successfully to start a new year, but this time around, when I try to build the new project an error occurs on a seemingly random line in the build.gradle file:
What went wrong:
A problem occurred evaluating root project ‘Robot23B’.
java.lang.NullPointerException (no error message)
On lline 118 in build.gradle there is an error highlight with this text:
Could not run phased build action using connection to Gradle distribution ‘https://services.gradle.org/distributions/gradle-7.2-bin.zip’.
Build file ‘C:\Users\workspace\FRC Java\Robot23B\build.gradle’ line: 118
A problem occurred evaluating root project ‘Robot23B’.Java(0)
I assume you mean 2023 installer. Note I am still running as 2022 and my 2022 projects build without incident. This problem project is just a copy of 2022 that will be used for beta test, but beta is not yet installed. build.gradle GradleRIO version is still 2022.4.1. I’m not clear why the gradle update is needed if I am not yet working under 2023 wpilib.
You said getting started for 2023, so I had assumed you had updated build.gradle for 2023. Sorry.
When you copied it, did you copy the .gradle folder? Iirc that folder is not path safe, and will break. Also try stopping any daemons, and maybe a reboot.
I did copy .gradle folder. Deleted it and rebooted. Problem persists. I can run with --stacktrace or --debug or --scan but the results tell me nothing I can use. What would be useful to determine what is wrong?
Would starting over and not copying .gradle folder be a good option?
Yes, that would probably work. Also make sure you remove any build or bin folder as well. Basically if it doesn’t go in git, don’t copy it. You can also try deleting your .gradle folder in your home directory, but you’ll lose some caches, and the next builds you do of everything will require internet.