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

Compilation of the generated code fails with protobuf 4.26.0 #752

Closed
sergeykad opened this issue Apr 2, 2024 · 3 comments
Closed

Compilation of the generated code fails with protobuf 4.26.0 #752

sergeykad opened this issue Apr 2, 2024 · 3 comments

Comments

@sergeykad
Copy link

The generated code does not compile with protobuf 4.26.0.

 error: cannot find symbol
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operatorId_)) {
                                             ^
  symbol:   method isStringEmpty(Object)
  location: class GeneratedMessage
@sergeykad sergeykad reopened this Apr 2, 2024
@ejona86
Copy link
Collaborator

ejona86 commented Apr 11, 2024

You are probably not using protoc 26. Protobuf 4.x is incompatible with the earlier generated code.

@sergeykad
Copy link
Author

It is running with com.google.protobuf:protoc:4.26.0 That's the version that you meant, correct?

I am not sure if it's related, but others also experience compilation issues with the protobuf 4.x grpc/grpc-java#11015

@ejona86
Copy link
Collaborator

ejona86 commented May 20, 2024

You need to match protobuf-java 4.26 with protoc 4.26. You can't use any 3.x generated code.

This is not a protobuf-gradle-plugin issue. This is just a protobuf issue.

I'm aware of the grpc issue. It's an ecosystem issue with protobuf. Protobuf will be releasing a new 3.x version that is more compatible with 4.x to ease upgrading. But all that is separate than this protobuf-gradle-plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants