首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >discord4j的符号引用错误

discord4j的符号引用错误
EN

Stack Overflow用户
提问于 2021-09-13 16:35:13
回答 1查看 60关注 0票数 0

我尝试在scala 3代码中使用discord4j 3.2和斜杠命令。当我为斜杠命令添加代码时,sbt在编译时给了我这个错误:

代码语言:javascript
复制
[error] Bad symbolic reference. A signature
[error] refers to Value/T in package org.immutables.value which is not available.
[error] It may be completely missing from the current classpath, or the version on
[error] the classpath might be incompatible with the version used when compiling the signature.
[warn] Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
[warn] externalName = org.immutables.value.Value$Immutable,
[warn] outerName = org.immutables.value.Value,
[warn] innerName = Immutable
[warn] owner.fullName = org.immutables.value.Value
[warn] while parsing ~/.cache/coursier/v1/https/oss.sonatype.org/content/repositories/snapshots/com/discord4j/discord-json/1.6.10-SNAPSHOT/discord-json-1.6.10-20210908.025209-4.jar(discord4j/discordjson/json/InteractionApplicationCommandCallbackData.class) while parsing annotations in ~/.cache/coursier/v1/https/oss.sonatype.org/content/repositories/snapshots/com/discord4j/discord-json/1.6.10-SNAPSHOT/discord-json-1.6.10-20210908.025209-4.jar(discord4j/discordjson/json/InteractionApplicationCommandCallbackData.class)
[error] Bad symbolic reference. A signature

我在scala 2代码中使用相同版本的discord4j编译代码创建斜杠命令没有任何问题。

这是我的sbt文件:

代码语言:javascript
复制
val scala3Version = "3.0.2"

val scala2deps = Seq(
  "com.typesafe.akka" %% "akka-actor" % "2.6.0",
  "com.typesafe.akka" %% "akka-actor-typed" % "2.6.0",
  "com.typesafe.akka" %% "akka-stream" % "2.6.8",
  "com.typesafe.akka" %% "akka-http" % "10.2.0",

  "org.scalaz" %% "scalaz-core" % "7.2.29",

  "io.projectreactor" %% "reactor-scala-extensions" % "0.8.+",

  "org.json4s" %% "json4s-jackson" % "3.+",

  "com.lihaoyi" %% "requests" % "0.2.0",
).map(d ⇒ d.cross(CrossVersion.for3Use2_13))

lazy val root = project
  .in(file("."))
  .settings(
    name := "PUGBot",
    version := "0.1.0",

    scalacOptions ++= Seq(
      "-language:postfixOps",
      "-language:implicitConversions",
      ),


    scalaVersion := scala3Version,

    resolvers += "d4j-snapshot" at "https://oss.sonatype.org/content/repositories/snapshots",

    libraryDependencies ++= Seq(
      "com.discord4j" % "discord4j-core" % "3.2.0-RC3",
    ) ++ scala2deps,

  )

如何修复此错误?

EN

回答 1

Stack Overflow用户

发布于 2021-10-20 12:49:22

我在de.flapdoodle.embed.mongo 3.0.0和Scala 3.0.2上也遇到了类似的问题:

代码语言:javascript
复制
scalac: Bad symbolic reference. A signature
refers to Value/T in package org.immutables.value which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling the signature.
代码语言:javascript
复制
scalac: Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
externalName = org.immutables.value.Value$Immutable,
outerName = org.immutables.value.Value,
innerName = Immutable
owner.fullName = org.immutables.value.Value
while parsing /Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.mongo/3.0.0/de.flapdoodle.embed.mongo-3.0.0.jar(de/flapdoodle/embed/mongo/config/MongodConfig.class) while parsing annotations in /Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.mongo/3.0.0/de.flapdoodle.embed.mongo-3.0.0.jar(de/flapdoodle/embed/mongo/config/MongodConfig.class)

我已经添加了org.immutables.value库作为Sbt依赖,这很有帮助:

代码语言:javascript
复制
"org.immutables" % "value" % "2.8.8"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69166256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档