withmarket-server/shop-review-reply

Error Messages during implementing gRPC Server or Client

BrianDYKim opened this issue · 1 comments

Preview

when using gRPC, we can encounter these messages if some dependencies are not implemented in build.gradle.kts:

1️⃣ When implementing gRPC interface on gRPC Server

cannot access 'io.grpc.kotlin.abstractcoroutineserverimpl' which is a supertype of ....

2️⃣ When implementing gRPC Stubs on gRPC Client

cannot access 'com.google.protobuf.generatedmessagev3' which is a supertype of ....

I'll give you the solutions about above things!

Solution

In gRPC Server, implement this dependency in your gRPC Server's build.gradle.kts:

dependencies {
    // ...omitted
    api("io.grpc:grpc-kotlin-stub:1.3.0")
    // ...omitted
}

In gRPC Client, implement this dependency in your gRPC Client's build.gradle.kts:

// apply the plugin of protobuf
apply(plugin = "com.google.protobuf")

// gRPC
dependencies {
    // ...omitted
    api("io.grpc:grpc-kotlin-stub:1.3.0")
    api("io.grpc:grpc-protobuf:1.49.0")
    // ...omitted
}

Then, you can implement gRPC server and client without any alert messages.

solved