marcoferrer / kroto-plus

gRPC Kotlin Coroutines, Protobuf DSL, Scripting for Protoc
Apache License 2.0
494 stars 28 forks source link

Cannot build provided template project #29

Closed jcornaz closed 5 years ago

jcornaz commented 5 years ago

Hi,

The instructions given here: https://github.com/marcoferrer/kroto-plus/tree/master/example-grpc-client-server#quick-start:

git clone https://github.com/marcoferrer/kotlin-coroutines-gRPC-template && \
cd kotlin-coroutines-gRPC-template && \
./gradlew run

produce the following output:

Cloning into 'kotlin-coroutines-gRPC-template'...
remote: Enumerating objects: 57, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 57 (delta 18), reused 44 (delta 9), pack-reused 0
Unpacking objects: 100% (57/57), done.
e: ~/Workspace/kotlin-coroutines-gRPC-template/api/build/generated/source/proto/main/coroutines/io/grpc/examples/helloworld/GreeterCoroutineGrpc.kt: (25, 25): Unresolved reference: Generated
e: ~/Workspace/kotlin-coroutines-gRPC-template/api/build/generated/source/proto/main/coroutines/io/grpc/examples/helloworld/GreeterCoroutineGrpc.kt: (37, 2): Unresolved reference: Generated
> Task :api:compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':api:compileKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
6 actionable tasks: 6 executed
marcoferrer commented 5 years ago

What it looks like to me is an unresolved reference to javax.annotation.Generated. Which comes from the jdk.

Which java version are you using?

I think your issue might be somewhat related to this grpc-issue

marcoferrer commented 5 years ago

If you are using jdk 9+ then you may experience issues with javax.annotation in general. The suggested fix mentioned here is adding the dependency explicitly.

compileOnly "javax.annotation:javax.annotation-api:1.2"

Thanks for pointing this out. Ill be sure to update the templates

jcornaz commented 5 years ago

Yes I am using a jdk 10.

I'll try the fix. Thanks for updating the template.

marcoferrer commented 5 years ago

I’m going to close out this issue. If you run into anymore issues with running the template project fell free to reopen. On a side note, when I updated the templates I removed a few code smells for ambiguous scope resolution. So you’ll want to be sure not to repeat the same mistakes.

jcornaz commented 5 years ago

OK, thanks @marcoferrer