gpt4 book ai didi

scala - Gradle Scala插件找不到ScalaObject

转载 作者:行者123 更新时间:2023-12-03 03:42:32 25 4
gpt4 key购买 nike

我在GitHub上有以下Gradle-based Scala project

如果克隆它并运行./gradlew run,则会出现以下异常:

:shared:compileJava UP-TO-DATE
:shared:compileScala
missing or invalid dependency detected while loading class file 'package.class'.
Could not access type ScalaObject in package scala,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'package.class' was compiled against an incompatible version of scala.
one error found
:shared:compileScala FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shared:compileScala'.
> Compilation failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

我从Google Gods能够找到的唯一可比较的堆栈跟踪都涉及SBT和Scala项目,而不是Gradle和Scala。

有人可以弄清楚这里发生了什么吗?

最佳答案

看来您遇到了一些依赖冲突。我已经看到您在子项目中使用了不同的Scala版本。这可能会在您的Scala版本和所包含的库之间引起一些二进制不兼容的问题。

例如,您正在使用'net.liftweb:lift-json_2.9.1:2.6.3',它与Scala 2.9.1二进制兼容,但是您有Scala 2.12.1Scala 2.11.8。这可能是潜在的问题候选者。

如果您是我,我将遍历所有依赖项列表,并检查项目所需的正确版本。

您可以使用:gradle dependenciesgradle dependencyInsight <dependency-name>
获取有关您的依赖项如何解决的更多信息。

我希望这是有帮助的。

关于scala - Gradle Scala插件找不到ScalaObject,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42775911/

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