Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sbt

scala.js

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

like image 513
Gábor Bakos Avatar asked Sep 13 '17 20:09

Gábor Bakos


2 Answers

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)

like image 170
Gábor Bakos Avatar answered Oct 14 '22 12:10

Gábor Bakos


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
like image 27
serv-inc Avatar answered Oct 14 '22 13:10

serv-inc