Unable to extend macros compiled by previous versions of Scala (scala 2.11.4, sbt 0.13.7, JDK 8)

I am converting a project in Scala 2.11.4 and sbt 0.13.7. I have a lot of errors, some of them:

can't expand macros compiled by previous versions of Scala [error] preloadDevice <<= preloadDeviceTask 

for this code:

 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) )) 

How to fix it?

UPDATE:

Jdk 8

+2
source share
1 answer

Hence: Why does the Def.inputTask macro not work in Scala 2.11.1?

In the build.sbt file, make sure you scalaVersion: = "2.10.4" instead of something like scalaVersion: = "2.11.x"

If you are using JDK 8, there are not many options like Sbt 0.13.x compiled with Scala 2.10.x:

  • use JDK7 only for sbt (setting a specific JAVA_HOME for sbt in your script run) - your project will still be compiled against JDK8
  • try JDK8 + Scala -2.10 for sbt (this may work, but no guarantees, of course)
  • build sbt 0.13 vs jdk8 yourself
+3
source

All Articles