Gradle Java project running into many proto related errors "cannot find symbol" randomly on compiling Java srcs
acmeofevolution opened this issue · 1 comments
We have a monorepo gradle project in git which contains Java, and Proto sub projects in it. We are using protobug-gradle-plugin (0.8.19 version of com.google.protobuf.gradle.ProtobufPlugin) to build our protos to corresponding .java files which seems to be working fine till we randomly run into weird "Cannot find symbol" errors (100s of such errors without any local changes) for the Proto usage in other existing Java classes. We checked for the presence of the .class/.java files and everything looks fine at the surface and we still face these errors. We are using Java version: OpenJDK 1.8.0_392-zulu (build 1.8.0_392-b08) and Gradle 8.5 version for this monorepo. Also, the errors happen in the dev environment locally and never shows up in our Jenkins build pipelines. To bypass these errors, we need to run ./gradlew clean
which cleans gradle cache and other related directories but developers lose quite a bit of time doing the build after a clean build.
Unfortunately, there are no clear/definite steps to reproduce this issue as I said it happens randomly. The most I can say that I have seen this happening if you try to pull the latest from git master to your local branch for the project after a few such pulls, it might show up. You might also be switching between the different git branches.
Has anyone ever seen anything like this before?
Please let me know if you need anymore information from my side to resolve this issue.