无法扩展以前版本的 Scala (scala 2.11.4, sbt 0.13.7, JDK 8) 编译的宏
Can't expand macros compiled by previous versions of Scala (scala 2.11.4, sbt 0.13.7, JDK 8)
我正在将项目转换为 Scala 2.11.4 和 sbt 0.13.7。我有很多错误,其中一些是:
can't expand macros compiled by previous versions of Scala
[error] preloadDevice <<= preloadDeviceTask
对于此代码:
lazy val settings: Seq[Setting[_]] = inConfig(Android) (Seq(
// Preload Scala on the device/emulator
preloadDevice <<= preloadDeviceTask,
preloadEmulator <<= InputTask(
(sdkPath)(AndroidProject.installedAvds(_)))(preloadEmulatorTask),
// Uninstall previously preloaded Scala
unloadDevice <<= unloadDeviceTask,
unloadEmulator <<= InputTask(
(sdkPath)(AndroidProject.installedAvds(_)))(unloadEmulatorTask)
))
我该如何解决?
更新:
JDK 8
从这里开始:Why doesn't the Def.inputTask macro work in Scala 2.11.1?
In your build.sbt file, make sure you scalaVersion := "2.10.4" instead
of something like scalaVersion := "2.11.x"
如果你使用 JDK 8,没有太多选项作为 Sbt 0。13.x 针对 Scala 2 编译。10.x:
- 仅对 sbt 使用 JDK7(通过在您的 运行-脚本中为 sbt 设置特定的 JAVA_HOME)——您的项目仍将针对 JDK8 进行编译
- 尝试 JDK8 + Scala-2.10 for sbt(它可能有效,但当然不能保证)
- 针对 JDK8 by yourself
构建 sbt 0.13
我正在将项目转换为 Scala 2.11.4 和 sbt 0.13.7。我有很多错误,其中一些是:
can't expand macros compiled by previous versions of Scala
[error] preloadDevice <<= preloadDeviceTask
对于此代码:
lazy val settings: Seq[Setting[_]] = inConfig(Android) (Seq(
// Preload Scala on the device/emulator
preloadDevice <<= preloadDeviceTask,
preloadEmulator <<= InputTask(
(sdkPath)(AndroidProject.installedAvds(_)))(preloadEmulatorTask),
// Uninstall previously preloaded Scala
unloadDevice <<= unloadDeviceTask,
unloadEmulator <<= InputTask(
(sdkPath)(AndroidProject.installedAvds(_)))(unloadEmulatorTask)
))
我该如何解决?
更新:
JDK 8
从这里开始:Why doesn't the Def.inputTask macro work in Scala 2.11.1?
In your build.sbt file, make sure you scalaVersion := "2.10.4" instead of something like scalaVersion := "2.11.x"
如果你使用 JDK 8,没有太多选项作为 Sbt 0。13.x 针对 Scala 2 编译。10.x:
- 仅对 sbt 使用 JDK7(通过在您的 运行-脚本中为 sbt 设置特定的 JAVA_HOME)——您的项目仍将针对 JDK8 进行编译
- 尝试 JDK8 + Scala-2.10 for sbt(它可能有效,但当然不能保证)
- 针对 JDK8 by yourself 构建 sbt 0.13