Skip to content

NoSuchMethodError with Scala 2.12.13 with version 5 #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arkangelboss-github opened this issue Jun 10, 2021 · 5 comments
Closed

NoSuchMethodError with Scala 2.12.13 with version 5 #156

arkangelboss-github opened this issue Jun 10, 2021 · 5 comments

Comments

@arkangelboss-github
Copy link

arkangelboss-github commented Jun 10, 2021

Hi all!

This seems to be the same issue (with the same stack trace) as in scoverage/scalac-scoverage-plugin#305

Caused by: java.lang.NoSuchMethodError: scala.tools.nsc.Global.reporter()Lscala/tools/nsc/reporters/Reporter;
        at scoverage.ScoverageInstrumentationComponent$$anon$1.run(plugin.scala:130)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1511)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1495)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1488)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1617)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
        at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
        at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:107)
        at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:53)
        at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
        at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:95)
        at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:95)
        at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:95)
        at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:168)
        at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:94)
        at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:142)
        at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:84)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
        at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:72)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:71)
        at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:99)
        at sbt.inc.Incremental$.compile(Incremental.scala:71)
        at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
        at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:159)
        at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:68)
        at com.typesafe.zinc.Compiler.compile(Compiler.scala:207)
        at com.typesafe.zinc.Compiler.compile(Compiler.scala:189)
        at com.typesafe.zinc.Compiler.compile(Compiler.scala:180)
        at com.typesafe.zinc.Compiler.compile(Compiler.scala:171)
        at org.gradle.api.internal.tasks.scala.ZincScalaCompiler$Compiler.execute(ZincScalaCompiler.java:86)
        at org.gradle.api.internal.tasks.scala.ZincScalaCompiler.execute(ZincScalaCompiler.java:57)
        at org.gradle.api.internal.tasks.scala.ZincScalaCompiler.execute(ZincScalaCompiler.java:40)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerWorkAction.execute(AbstractDaemonCompiler.java:113)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:47)
        at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:46)
        at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:36)
        at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
        at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:36)
        at org.gradle.workers.internal.IsolatedClassloaderWorker.execute(IsolatedClassloaderWorker.java:54)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:56)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:118)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)

Compiling using scala 2.12 builds up to 2.12.12 works fine.

@maiflai
Copy link
Contributor

maiflai commented Jun 13, 2021

It seems that the workaround of using the latest upstream plugin doesn't work (#155 has been kindly submitted to fix this).

Can you try the previous version's workaround?

scoverage {
    scoverageVersion = '1.4.5'
    scoverageScalaVersion = '2.12.13'
}

I need to review that before we can move forward, sorry.

Stu

@arkangelboss-github
Copy link
Author

arkangelboss-github commented Jun 14, 2021

Hi @maiflai! and thanks for looking into this 🥇

NEVER MIND HERE

I tried with the explicit configuration

scoverage {
    scoverageVersion = '1.4.5'
    scoverageScalaVersion = '2.12.13'
}

I get the same issue

Caused by: java.lang.NoSuchMethodError: scala.tools.nsc.Global.reporter()Lscala/tools/nsc/reporters/Reporter;
        at scoverage.ScoverageInstrumentationComponent$$anon$1.run(plugin.scala:130)

LOOK HERE

It turns out I missed a file and it worked with the explicit configuration.

Let me know if I can try to collect more data: I cannot get past version 1.4.5 because the org.scoverage:scalac-scoverage-runtime version is not compiled against the full scala version it seems (see https://mvnrepository.com/artifact/org.scoverage/scalac-scoverage-runtime)

@maiflai
Copy link
Contributor

maiflai commented Jul 24, 2021

Sorry for the delay, I've got past my local problems and published 6.0.0 of the plugin which should help you get past 1.4.5.

@arkangelboss-github
Copy link
Author

Sorry for the delay, I've got past my local problems and published 6.0.0 of the plugin which should help you get past 1.4.5.

Looking to confirm!

@arkangelboss-github
Copy link
Author

It seems the workaround is no longer necessary with version 6.0.0 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants