Plugin with Scala 2.11 and scalafmt 1.1.0 cause NoSuchMethodError
See original GitHub issueWe use Scala 2.11.11 plugins.sbt:
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
build.sbt
scalafmtVersion in ThisBuild := "1.1.0"
sbt scalafmt
throws
java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V
at scala.meta.inputs.Input$String.<init>(Input.scala:23)
at scala.meta.inputs.Input$String$.apply(Input.scala:23)
at org.scalafmt.config.Config$.fromHoconString(Config.scala:55)
at com.lucidchart.scalafmt.impl.ScalafmtFactory.fromConfig(ScalafmtFactory.scala:11)
at com.lucidchart.scalafmt.impl.ScalafmtFactory.fromConfig(ScalafmtFactory.scala:9)
at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$18.apply(ScalafmtCorePlugin.scala:143)
at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$18.apply(ScalafmtCorePlugin.scala:134)
...
My guess is that this is because scalafmt-impl
1.10-1.0 has not been published for Scala 2.11 so it tries to use scalafmt-impl_2.12
in a Scala 2.11 project.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
scalameta/scalafmt - Gitter
the SBT plugin seems to have never ending problems, I've tried to get some extra help to maintain the plugin but no luck...
Read more >Errors at scalafmt download attempt after changing to it in ...
Created a new scala sbt project with some code inside ... ACTUAL: Following errors at scala fmt download attempt (similar occur in case...
Read more >java.lang.NoSuchMethodError: scala.Predef$.refArrayOps
This specific error happens when you use Scala 2.11 JAR files in Scala 2.12 projects. Scalatest is cross compiled with Scala 2.11 and...
Read more >sbt Reference Manual - Manualzz
Supports testing with ScalaCheck, specs, and ScalaTest. JUnit is supported by a plugin. • Starts the Scala REPL with project classes and dependencies...
Read more >FAQ / Troubleshooting · Scalafmt - Scalameta
If for some reason you cannot use IntelliJ 2019.1 or later (e.g. licensing), the legacy documentation below describes how to use the dedicated...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dragisak I also solved the error by manually specifying the
scalafmtVersion
, maybe the default value for the version is a bit off?@dragisak I was able to resolve that error by removing
scalafmtVersion := "1.0.0-RC4"
from the build.sbt. I am not sure about the reason though.