question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin with Scala 2.11 and scalafmt 1.1.0 cause NoSuchMethodError

See original GitHub issue

We 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mdedetrichcommented, Aug 20, 2017

@dragisak I also solved the error by manually specifying the scalafmtVersion, maybe the default value for the version is a bit off?

1reaction
puneetarcommented, Aug 18, 2017

@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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found