Gábor Bakos
Gábor Bakos

Reputation: 9100

java.lang.NoSuchMethodError: sbt.package$.Zero()Lsbt/Global$;

When using Scala.js 0.6.20 (addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.20") in project/plugins.sbt), the following error happens when trying to sbt import the project using sbt 0.13.15:

java.lang.NoSuchMethodError: sbt.package$.Zero()Lsbt/Global$;
        at org.scalajs.sbtplugin.ScalaJSPluginInternal$.org$scalajs$sbtplugin$ScalaJSPluginInternal$$scalaJSStageSettings(ScalaJSPluginInternal.scala:254)
        at org.scalajs.sbtplugin.ScalaJSPluginInternal$$anonfun$22.apply(ScalaJSPluginInternal.scala:446)
        at org.scalajs.sbtplugin.ScalaJSPluginInternal$$anonfun$22.apply(ScalaJSPluginInternal.scala:446)
        at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:54)
        at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:53)

Similar problem: https://gitter.im/scala-js/scala-js?at=59b53890b59d55b823db1dcd

Upvotes: 9

Views: 1686

Answers (2)

serv-inc
serv-inc

Reputation: 38307

Alternative: downgrade scala.js to 0.6.19 (say, for Coursera course capstone)

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.19") >> project/plugins.sbt

Upvotes: 1

Gábor Bakos
Gábor Bakos

Reputation: 9100

As the release notes mention, Scala.js 0.6.20 requires sbt 0.13.16 or above. To achieve this, the project/build.properties file should be modified to set:

sbt.version=0.13.16

(or something compatible)

Upvotes: 19

Related Questions