【问题标题】:grpc-java use in androidgrpc-java在android中的使用
【发布时间】:2015-03-12 14:55:31
【问题描述】:

我用

protoc -I examples/src/main/proto -I examples/build/extracted-protos/main --java_out=examples/build/generated-sources/main --java_plugin_out=examples/build/generated-sources/main --plugin=protoc-gen-java_plugin=compiler/build/binaries/java_pluginExecutable/java_plugin examples/src/main/proto/route_guide.proto

生成代码。

当我为此 proto 文件修改 Android 演示时,运行 ./gradlew installDebug 我遇到了问题:

no suitable constructor found for HelloRequest()
            HelloRequest message = new HelloRequest();
                                   ^
    constructor HelloRequest.HelloRequest(CodedInputStream,ExtensionRegistryLite) is not applicable
      (actual and formal argument lists differ in length)
    constructor HelloRequest.HelloRequest(Builder) is not applicable
      (actual and formal argument lists differ in length)

【问题讨论】:

  • 你需要显示一些代码。

标签: android grpc


【解决方案1】:

我解决了:

protoc --plugin=protoc-gen-java_rpc=compiler/build/binaries/java_pluginExecutable/java_plugin --java_rpc_out=nano=true:"examples/build/generated-sources/main/" --proto_path="examples/src/main/proto/" --javanano_out=ignore_services=true:"examples/build/generated-sources/main/" "examples/src/main/proto/helloworld.proto"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-09
    • 2021-11-11
    • 1970-01-01
    • 1970-01-01
    • 2021-11-30
    • 2021-04-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多