Make sure the com.google.protobuf:protobuf-java dependency is the same version as the protoc compiler. This is likely the problem here. You can find the duplicate issue in gRPC Java: https://github.com/grpc/grpc-java/issues/11925
com.google.protobuf:protobuf-java