类路径中缺少符号“type shapeless.LeftFolder”

The*_*ark 0 scala compiler-errors intellij-idea apache-spark

快速帮助解决这个问题。在编译期间,我收到以下错误集;

Error:(38, 21) Symbol 'type shapeless.HListerAux' is missing from the classpath.
This symbol is required by 'value spray.routing.directives.ParamDefMagnet2.hla'.
Make sure that type HListerAux is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.
          parameter('id) { id =>

Error:(38, 21) Symbol 'type shapeless.Poly.Case2' is missing from the classpath.
This symbol is required by 'method spray.routing.directives.ParamDefMagnet2.MapReduce.from'.
Make sure that type Case2 is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.Poly.
          parameter('id) { id =>

Error:(38, 21) Symbol 'type shapeless.PrependAux' is missing from the classpath.
This symbol is required by 'value spray.routing.directives.ParamDefMagnet2.MapReduce.ev'.
Make sure that type PrependAux is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.
          parameter('id) { id =>

Error:(38, 21) Symbol 'type shapeless.HListerAux' is missing from the classpath.
This symbol is required by 'value spray.routing.directives.ParamDefMagnet2.hla'.
Make sure that type HListerAux is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'ParamDefMagnet2.class' was compiled against an incompatible version of shapeless.
          parameter('id) { id =>
Run Code Online (Sandbox Code Playgroud)

虽然,总而言之,问题出在“shapeless”上,我已经将其作为依赖项包含在内(与解析器一起),

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  Resolver.sonatypeRepo("snapshots")
)

libraryDependencies ++= Seq(
  "com.chuusai" %% "shapeless" % "2.3.2"
) 
Run Code Online (Sandbox Code Playgroud)

我会很感激一个合适的建议作为修复。

小智 5

我知道如何解决它,我以前遇到过这个问题。是Shapeless Versions问题,仔细阅读下面的气味,你会解决这个问题的。

Shapeless Versions 如果你想在你的应用程序中使用shapeless 和spray-routing,你需要选择针对你想要使用的shapeless 版本构建的spray(-routing) 版本。对于无形的 1.2.4,您应该使用喷雾 1.1.4、1.2.4 或 1.3.4 和喷雾路由模块。不再支持 shapeless 2.0.0。 对于 shapeless 2.3.0,您应该使用 spray 1.3.4(Scala 2.10 或 Scala 2.11)和 spray-routing-shapeless23 模块而不是 spray-routing

libraryDependencies ++= "io.spray" %% "spray-routing-shapeless23" % "1.3.4",
Run Code Online (Sandbox Code Playgroud)