Akka版本问题

rsaldnfx  于 2023-06-22  发布在  其他
关注(0)|答案(1)|浏览(133)

我正在为我的项目使用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]

注意-我甚至尝试了这个问题的解决方案link,也就是说,在错误消息中添加了所有提到的akka依赖,但仍然得到相同的错误。

az31mfrm

az31mfrm1#

尝试使用sbt dependencyTree,然后通过它查找其中一个冲突库,例如ask akka-cluster
正如其他人所提到的,在某个地方,您依赖于旧版本的Akka。我同意Ivan的观点,它很可能在你的Play导入中,但是依赖关系树可以帮助你确认这一点,并可能指向你解决它。

相关问题