-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
java.lang.IllegalAccessError: tried to access method 'com.google.protobuf.LazyStringArrayList' #1657
Comments
I think that ScalaPB should work with recent versions of protobuf-java (such as 3.22.x). Can you share more information about your project? Are you generating Scala and Java code? Are you setting |
Oh so this is just my misunderstanding. I thought I just will not work. |
I haven't tested this specific configuration, so it may or may not work. However, generally it should be ok to use a newer protobuf-java and protoc than the one used with ScalaPB. Please test that and report here you see any issues. |
It looks like protobuf v3.22.0 introduces incompatible change in I tried to compile scala proto librarary with current scalapb and protobuf-java + protoc 3.22.5 and get such error: Then I upgrade protobuf (and protoc) in scalapb repo to 3.22.5 and just recompiled compilerplugin. It fixes the problem. Would you mind to upgrade protobuf to 3.22.5? |
@kusaeva can you provide a minimal project that demonstrates the problem? I prefer to refrain from a releasing a 0.12.0 if not necessary. |
sure, here it is https://github.com/kusaeva/scalapb-protobuf-22.5 |
Thanks for sending this. It looks like the use of |
I used dependencyOverrides just for example. My real project built with bazel, where I have to use certain protobuf version (22.5). And I get the same error |
Got it. I am planning of making a release with a more recent version of protobuf. However, since the problem occurs at compile time, it looks like the generator isn't running in isolation as I thought (we have a custom class loader that was meant to provide that). So upgrading can cause binary incompatibility for users who need the older version at compile time. While we do the new release, care to share a bazel reproduction of the issue? I am not sure how the class loading for the generator works there. |
Sorry for late reply, I've added bazel build to the same repro repository: https://github.com/kusaeva/scalapb-protobuf-22.5 |
Hello!
I am using scalapb in my repository and now have to use some library with dependency on protobuf-java:3.22.5
Now I am on protobuf-java:3.19.2 and the code fails with:
This issue says it should work with protobuf-java > 3.22.0
This comment says protobuf 3.21 will be here only by next major release of ScalaPB (0.12)
But what about 3.22?
Maybe you can give me some advices or workarounds how to use scalaPB and up-to-date protobuf together?
The text was updated successfully, but these errors were encountered: