Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object grpc is not a member of package play; PlayRouter can not be found #374

Closed
bmo-at opened this issue Oct 18, 2021 · 1 comment
Closed

Comments

@bmo-at
Copy link

bmo-at commented Oct 18, 2021

Hi, I am relatively new to Scala and Akka in general, so I'm hoping this won't be a big issue and I am missing something simple.
I am trying to add grpc endpoints to an existing API. After upgrading to Play 2.8.8 I run into the following issue:
On compiling, after the Server Code is generated, sbt tells me that it encountered 3 errors:

[error] /home/jan-robin.aumann/dev/caplon-rest/voip/target/scala-2.12/akka-grpc/main/com/consistec/voip/grafana/grpc/AbstractRouter.scala:11:13: object grpc is not a member of package play
[error] import play.grpc.internal.PlayRouter
[error]             ^
[error] /home/jan-robin.aumann/dev/caplon-rest/voip/target/scala-2.12/akka-grpc/main/com/consistec/voip/grafana/grpc/AbstractRouter.scala:18:13: not found: type PlayRouter
[error]     extends PlayRouter(GrafanaQueryAPI.name)
[error]             ^
[error] /home/jan-robin.aumann/dev/caplon-rest/voip/target/scala-2.12/akka-grpc/main/com/consistec/voip/grafana/grpc/AbstractRouter.scala:18:40: no arguments allowed for nullary constructor Object: ()Object
[error]     extends PlayRouter(GrafanaQueryAPI.name)
[error]                                        ^
[warn] two warnings found
[error] three errors found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 118 s (01:58), completed Oct 18, 2021, 10:15:47 AM

Looking for solutions I found #215 #40 and #228 and at first I thought they might be related, but if they are I shouldn't be running into my issue...

General info:
sbt version: 1.5.5
scala version: 2.12.7
Play version: 2.8.8
Akka-grpc version: 1.0.3 (upgrade to 2.1.0 asap, but currently impossible due to dependency on scalapb 0.10.10 with custom changes)

@bmo-at
Copy link
Author

bmo-at commented Oct 18, 2021

One should include the proper dependency on play-grpc-runtime at the proper place in the build.sbt file like so:
libraryDependencies += "com.lightbend.play" %% "play-grpc-runtime" % "0.9.1"

@bmo-at bmo-at closed this as completed Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant