Is it required to set `java_multiple_files = true` option in proto definition
See original GitHub issueWhen I try to build the project without setting java_multiple_files = true
option in proto definition, I got Unresolved reference:
error. It seems like the generated code referring to message type like <service-name>.<message-name>
but there is no java class generated with the service-name.
When I set the java_multiple_files
option to true. The code generates correctly and builds successfully.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Language Guide | Protocol Buffers - Google Developers
Here's the .proto file you use to define the message type. message SearchRequest { required ... To do this you need to set...
Read more >proto3: Why setting java_multiple_files = true not creating ...
I have a proto definition with nested classes
Read more >proto3: Why setting java_multiple_files = true ... - Google Groups
I have a proto definition with nested classes. syntax = "proto3";. option java_package = "com.spot.proto.v1.config";. package v1config;.
Read more >Extending Protobuf: custom options - Giorgio Azzinnaro
google.protobuf"; option java_outer_classname = "AnyProto"; option java_multiple_files = true; option objc_class_prefix = ...
Read more >Protobuf Service Descriptors • Akka gRPC - Documentation
gRPC uses the Protobuf .proto file format to define your messages, services and some ... source option java_multiple_files = true; option java_package ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I found the issue. The problem comes when the proto file name is equal to the service name define inside the proto file. For example: Let say we have a proto file called
hello_world.proto
and service definition inside the proto file like belowHere proto filename is
hello_world.proto
and service name isHelloWorld
.When we generate the code, Generated java class is
HelloWorldOuterClass.java
. but generated Kotlin file is referring to theHelloWorld.HelloRequest
for the message type. which causes the: Unresolved reference: HelloWorld
Sounds like a valid bug.