Closed santhanamk closed 4 months ago
As the error specifies, you cannot define extensions in proto3 files. Change the syntax or don't use an extension?
Ok thanks for your reply! Why is it that other libraries like KrotoDC or even the protoc-gen/protobuf libraries for Java/Kotlin are able to process this file without crashing?
Is the Wire Compiler more strict?
Also, what would be an alternate syntax that I could use?
Thank you. It looks like we missed that when adding proto3 support. Extensions are allowed for defining options, even in proto3 files. I can fix that at some point but your best move right now would be to move this extension definition in a proto2 file.
Actually @santhanamk you can get your build pass by removing the leading .
.
- extend .google.protobuf.MethodOptions {
+ extend google.protobuf.MethodOptions {
@oldergod if I remove the .
. I see this error:
I think it is due to the descriptor.proto
import above.
For proto3 however, after I remove the .
and do a Build in Android Studio wire is successful, and still generates all of the proto files. Do you think the HttpRule is getting ignored somehow?
If I downgrade to proto2 and move that extend
into there then that does work as well.
Do you know by roughly when you could fix this bug? Thanks for your help.
Any syntax error in the .proto
file is only noise. You gotta run Wire to be sure that it works or not.
The fix, I would not count on it before the summer. Might happen before.
ok thank you!
I have this annotations.proto file:
But when it gets processed by the Wire Gradle plugin (via Android Studio) I get this crash:
Cause: extensions are not allowed in proto3 for extend google.protobuf.MethodOptions (...app/src/main/proto/google/annotations.proto:28:1)
Is there a workaround or solution for this?