grpc-kotlin icon indicating copy to clipboard operation
grpc-kotlin copied to clipboard

task generateProto failed

Open Bleoo opened this issue 4 years ago • 5 comments

gradle:

plugins {
    id "org.jetbrains.kotlin.jvm" version "1.3.72"
    id "org.jetbrains.kotlin.plugin.spring" version "1.3.72"
    ...
    id 'com.google.protobuf' version '0.8.13'
}
protobuf {
    protoc {
        artifact = "com.google.protobuf:protoc:3.2.0"
    }
    generatedFilesBaseDir = "src/generated"
    plugins {
        grpc {
            artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
        }
        grpckt {
            artifact = "io.grpc:protoc-gen-grpc-kotlin:0.2.1:jdk7@jar"
        }
    }
    generateProtoTasks {
        all()*.plugins {
            grpc {}
            grpckt {}
        }
    }
}

error :

Execution failed for task ':generateProto'.
> protoc: stdout: . stderr: Activity.proto: warning: Import google/protobuf/wrappers.proto but not used.
  src/generated/main/grpckt/com\some\activity\grpc\ActivityProtoGrpcKt.kt: No such file or directory

Bleoo avatar Dec 09 '20 06:12 Bleoo

I think that the generatedFilesBaseDir = "src/generated" is causing an issue. What happens if you remove it?

jamesward avatar Dec 09 '20 18:12 jamesward

After removal, it is still the same error

Bleoo avatar Dec 10 '20 04:12 Bleoo

This looks like a path issue (using forward and back slashes). What OS are you on?

jamesward avatar Dec 10 '20 15:12 jamesward

windows 10 , jdk8

Bleoo avatar Dec 11 '20 02:12 Bleoo

Do you get the same error with an unmodified sample app, like: https://github.com/GoogleCloudPlatform/kotlin-samples/tree/master/run/grpc-hello-world-gradle

jamesward avatar Dec 11 '20 15:12 jamesward