简体   繁体   中英

Can't expand macros compiled by previous versions of Scala

I changed my Scala version from 2.10.x to 2.11.8. I am getting some compilation issues. I tried, but still not able to resolve because I am poor in Scala and sbt.

WebService.scala:36: can't expand macros compiled by previous versions of Scala
[error]         logger.error(s"WebService.getSiteData(${Id}): Unknown Error, Error Message: $e")

What might be the issue here?

I resolved this issue but it not a single thing, I did couple of things:

  1. First I gone through the error location in WebService.scala.
  2. Then to the corresponding "Logger" class.
  3. I check from which jar that "Logger" class coming.
  4. I found that it referring to some thing else jar than what I am expecting.
  5. That jar is coming from one of my dependent project (modules) so in build.sbt, those dependent jars I excluded that wrong jar which I found.
  6. After I changed the code in WebService.scala, I removed that import for logger and added new import having Logger what I expecting. I did same all the other places in my project.

     WebService.scala:36: can't expand macros compiled by previous versions of Scala [error] logger.error(s"WebService.getSiteData(${Id}): Unknown Error, Error Message: $e")

This is not particular to logger issue. If you are getting "can't expand macros compiled by previous versions of Scala" issue", you have to do same procedure for corresponding to your error (my case logger).

First time, I search online regarding this issue, I found same issue facing lot of people, but different library classes (I face Logger class issue).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM