我正在设置新服务器。服务器启动,但出现错误。
对象注入不是com.google软件包的成员
我不知道该怎么办。 在Internet上,我看到了一个与build.sbt文件相关联的解决方案,但是我不知道在那里要更改什么以及如何更改控制器本身。
我的build.sbt
...
TextView textViewTime = findViewById(R.id.textTimer);
Application.scala
lazy val server = (project in file("server"))
.settings(
name := "server",
version := Settings.version,
scalaVersion := Settings.versions.scala,
scalacOptions ++= Settings.scalacOptions,
libraryDependencies ++= Settings.jvmDependencies.value,
commands += ReleaseCmd,
compile in Compile := ((compile in Compile) dependsOn
scalaJSPipeline).value,
scalaJSProjects := clients,
pipelineStages in Assets := Seq(scalaJSPipeline),
pipelineStages := Seq(digest, gzip),
LessKeys.compress in Assets := true
)
.enablePlugins(PlayScala)
.disablePlugins(PlayLayoutPlugin)
.aggregate(clients.map(projectToRef): _*)
.dependsOn(sharedJVM)
lazy val ReleaseCmd = Command.command("release") {
state => "set elideOptions in client := Seq(\"-Xelide-below\",
\"WARNING\")" ::
"client/clean" ::
"client/test" ::
"server/clean" ::
"server/test" ::
"server/dist" ::
"set elideOptions in client := Seq()" ::
state
}
...
错误
...
package controllers
import java.nio.ByteBuffer
import boopickle.Default._
import com.google.inject.Inject
import play.api.{Configuration, Environment}
import play.api.mvc._
import services.ApiService
import spatutorial.shared.Api
class Application @Inject() (implicit val config: Configuration, env:
Environment) extends Controller {
val apiService = new ApiService()
def index = Action {
Ok(views.html.index("lain"))
}
...
添加“ com.google.guava”%“ guava”%“ 28.0-jre”