Akka版本问题

huangapple go评论74阅读模式
英文:

Akka Version Issue

问题

我正在使用Akka来开发我的项目。

这里是Dependencies.scala的部分代码:

import play.sbt.PlayImport.caffeine
import sbt._

object Dependencies {

  val akkaActorVersion = "2.6.19"

  val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % akkaActorVersion
  val akkaProtobuf = "com.typesafe.akka" %% "akka-protobuf" % akkaActorVersion
  val akkaRemote = "com.typesafe.akka" %% "akka-remote" % akkaActorVersion

  val clientAPIDependencies: Seq[ModuleID] = Seq(
    Dependencies.akkaCluster,
    Dependencies.akkaProtobuf,
    Dependencies.akkaActorType,
    caffeine
  )
}

错误

java.lang.IllegalStateException: You are using version 2.6.19 of Akka, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 2.6.19 of the [akka-cluster, akka-protobuf, akka-remote] artifacts to your project. Here's a complete collection of detected artifacts: (2.5.25, [akka-cluster, akka-protobuf, akka-remote]), (2.6.19, [akka-actor, akka-actor-typed, akka-protobuf-v3, akka-serialization-jackson, akka-slf4j, akka-stream]). See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
[error]

注意 - 我甚至尝试了这个解决方案链接,即将错误消息中提到的所有Akka依赖项都添加到项目中,但仍然收到相同的错误。

英文:

I am using Akka for my project.

Here, the Dependencies.scala

import play.sbt.PlayImport.caffeine
import sbt._

object Dependencies {

  val akkaActorVersion      = "2.6.19"


  val akkaCluster       = "com.typesafe.akka"      %% "akka-cluster"        % akkaActorVersion
  val akkaProtobuf      = "com.typesafe.akka"      %% "akka-protobuf"       % akkaActorVersion
  val akkaRemote        = "com.typesafe.akka"      %% "akka-remote"         % akkaActorVersion

  val clientAPIDependencies: Seq[ModuleID] = Seq(
     Dependencies.akkaCluster,
     Dependencies.akkaProtobuf,
     Dependencies.akkaActorType,
    caffeine
  )

}

Error:-

java.lang.IllegalStateException: You are using version 2.6.19 of Akka, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 2.6.19 of the [akka-cluster, akka-protobuf, akka-remote] artifacts to your project. Here's a complete collection of detected artifacts: (2.5.25, [akka-cluster, akka-protobuf, akka-remote]), (2.6.19, [akka-actor, akka-actor-typed, akka-protobuf-v3, akka-serialization-jackson, akka-slf4j, akka-stream]). See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
[error] 

NOTE - I even tried the solution of this also link, i.e., adding all mentioned akka dependencies in the error message but still getting the same error.

答案1

得分: 2

尝试使用 sbt dependencyTree 然后通过它来查找冲突的库之一,比如 akka-cluster

正如其他人所提到的,某处您依赖了较旧版本的 Akka。我同意 Ivan 的观点,很可能在您的 Play 导入中,但依赖树可以帮助您确认这一点,可能会指引您解决它。

英文:

Try using sbt dependencyTree and then grepping through it for one of the conflicting libraries, such ask akka-cluster.

As others have mentioned, somewhere you have a dependency on an older version of Akka. I agree with Ivan, that it is likely in your Play import, but the dependency tree could help you confirm that and potentially point you towards resolving it.

huangapple
  • 本文由 发表于 2023年6月19日 17:31:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76505335.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定