grpc / grpc-kotlin

Kotlin gRPC implementation. HTTP/2 based RPC
https://grpc.io/docs/languages/kotlin
Apache License 2.0
1.2k stars 165 forks source link

compilation error after upgrading grpc-java to 1.40.1 io.grpc.stub.annotations.GrpcGenerated #285

Open xmlking opened 3 years ago

xmlking commented 3 years ago

I am getting compilation error after upgrading grpc version from 1.39.0 to 1.40.1 looks like they added io.grpc.stub.annotations.GrpcGenerated which is missing in grpc-kotlin which depends on grpc-java 1.36.0

Error

/generated/source/proto/main/grpc/micro/apps/proto/order/v1/ProductServiceGrpc.java:13: error: cannot find symbol
@io.grpc.stub.annotations.GrpcGenerated
                         ^
  symbol:   class GrpcGenerated
  location: package io.grpc.stub.annotations

is there a way to force grpc-kotlin to use grpc-java 1.40.1 version?

xmlking commented 3 years ago

image

jamesward commented 3 years ago

You need to manually add the grpc-stub dependency, like:

implementation("io.grpc:grpc-stub:1.40.1")

We should look at bumping our deps to fix this.

DanteAndroid commented 2 years ago

@jamesward Hi, after update my gradle to https://github.com/grpc/grpc-kotlin/blob/master/examples/stub-android/build.gradle.kts and added implementation("io.grpc:grpc-stub:1.40.1"), I got inferred type is [My proto model class] but Serializable? was expected error. Why does GeneratedMessageLite not extend from Serializable any more?

jamesward commented 2 years ago

Note sure. Maybe @lowasser knows. Also you may want to try a newer version than that.