gpt4 book ai didi

scala - 运行时出现 "play"java.lang.NoSuchMethodError

转载 作者:行者123 更新时间:2023-12-03 04:40:36 24 4
gpt4 key购买 nike

我正在尝试运行从 git clone https://github.com/djonmayer/play21-osm.git 获得的 play 项目的克隆。

我安装了 play 版本 2.2.2 和 scala 版本 2.10.4。

当我在项目克隆到的目录中输入 play 时,出现以下错误:

java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps;
at sbt.ConsoleLogger$.<init>(ConsoleLogger.scala:129)
at sbt.ConsoleLogger$.<clinit>(ConsoleLogger.scala)
at sbt.StandardMain$.<init>(Main.scala:52)
at sbt.StandardMain$.<clinit>(Main.scala)
at sbt.xMain.run(Main.scala:26)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:57)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:77)
at xsbt.boot.Launch$.run(Launch.scala:57)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:65)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:32)
at xsbt.boot.Boot$.main(Boot.scala:21)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps;

如果我运行play clean,情况就是如此。我读到这可能是一个依赖项问题,所以我尝试将行 scalaVersion := "2.10.4" 添加到 Build.scala 的 play.Project.settings 部分并分别在 build.sbt 文件中。它不起作用。

最佳答案

我试图将其放入评论中,但它不可读。

谢谢,泽帕曼。看起来这个问题确实与运行在旧版 Play 中创建的 Play Framework 项目有关。通过查看另一个已 promise 升级到新游戏版本的项目,我进行了以下更改。

在 build.properties 中:

sbt.version=0.12.2

变成:

sbt.version=0.13.0

在plugins.sbt中:

addSbtPlugin("play" % "sbt-plugin" % "2.1.1")

变成:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2")

这使我能够玩更新然后抛出错误:

[error] Modules were resolved with conflicting cross-version suffixes in {file:/Users/michaelrichardson/Documents/Play/play21-osm/}play21-osm:
[error] org.scala-stm:scala-stm _2.10, _2.10.0
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) Conflicting cross-version suffixes in: org.scala-stm:scala-stm

我更改了 Build.scala 中的行:

    "com.typesafe.play" %% "play-slick" % "0.3.2"

变成:

    "com.typesafe.play" %% "play-slick" % "0.5.0.2-SNAPSHOT"

额外:这会将错误更改为:

[info] Resolving com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT ...
[warn] module not found: com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/typesafe/play/play-slick_2.10/0.5.0.2-SNAPSHOT/play-slick_2.10-0.5.0.2-SNAPSHOT.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#play-slick_2.10;0.5.0.2-SNAPSHOT: not found

更新:解决了 Unresolved 依赖关系

Unresolved 依赖关系问题似乎可能是由于我的本地 sbt/ivy 存储库损坏所致。请参阅unresolved dependency: com.typesafe.play#play-slick_2.10;0.6.0.1: not found

关于scala - 运行时出现 "play"java.lang.NoSuchMethodError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23320832/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com