I try to compile proto definitions into kotlin stubs, but get import issues. My gradle is
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.21.2"
}
plugins {
grpckt {
artifact = "io.grpc:protoc-gen-grpc-kotlin:1.3.0:jdk8@jar"
}
}
generateProtoTasks {
all().forEach { task ->
task.builtins {
grpckt {
option 'lite'
}
}
task.plugins {
kotlin {
option 'lite'
}
}
}
}
}
dependencies {
//grpc dependency
implementation("io.grpc:grpc-kotlin-stub:1.3.0")
implementation 'io.grpc:grpc-okhttp:1.47.0'
implementation("io.grpc:grpc-protobuf:1.47.0")
implementation("com.google.protobuf:protobuf-kotlin:3.21.12")
implementation 'io.grpc:grpc-protobuf-lite:1.47.0'
}
I have few proto files. After proto compiled I get the files with import errors:
option java_multiple_files = true - doesn`t help.
It might be too late, but for all those who found their way here through Google, you also need to generate Java source files to make this work.