Skip to content

annotation error from generated proto files #499

Open
@zabakala

Description

@zabakala

Hi. Would you be able to assist me in the following error inside IntelliJ? Anytime I generate kotlin files from the proto ones I end up with an erroneous generated code.

My build.gradle.ts:

protobuf {
    protoc{
        artifact = "com.google.protobuf:protoc:3.25.1"
    }
    plugins {
        create("grpc") {
            artifact = "io.grpc:protoc-gen-grpc-java:1.60.0"
        }
        create("grpckt") {
            artifact = "io.grpc:protoc-gen-grpc-kotlin:1.4.1:jdk8@jar"
        }
    }
    generateProtoTasks {
        all().forEach {
            it.plugins {
                create("grpc")
                create("grpckt")
            }
            it.builtins {
                create("kotlin")
            }
        }
    }
}

The proto source file:

syntax = "proto3";

package com.heu.malheu.service;

option java_outer_classname = "CustomerProto";
option java_multiple_files = true;

service Customer {
  rpc getByEmail(ByEmailRequest) returns (byEmailReply) {}
}

message ByEmailRequest {
  string name = 1;
}

message byEmailReply {
  string message = 1;
}

...and the result:

annotationerror

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions