1

I am using akka.http in my Scala code in Intellij. But when I try to build my project I get the following error:

scalac: error while loading Http, class file 'C:\Users\XXXXXX.m2\repository\com\typesafe\akka\akka-http-core_2.13\10.2.9\akka-http-core_2.13-10.2.9.jar(akka/http/scaladsl/Http.class)' is broken (class java.lang.RuntimeException/error reading Scala signature of Http.class: Scala signature Http has wrong version expected: 5.0 found: 5.2 in Http.class)

My POM.xml looks like following:

 <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-actor_3</artifactId>
        <version>2.6.19</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-http -->
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-http_2.13</artifactId>
        <version>10.2.9</version>
    </dependency>

My Project structure libraries looks like this:

enter image description here

What Can I do to resolve this error?. Thanks in advance.

abhishek
  • 29
  • 4

2 Answers2

1

I could resolve this issue with latest version of http-akka.

abhishek
  • 29
  • 4
0

Scala dependencies are built with an specific scala version, and you should match your different dependencies versions, they are also specified in the artifact id after the underscore "_" sign, so you were trying to use an akka-actor_3 scala version 3, with an akka-http_2.13 built for scala version 2.13, so they were uncompatible

Char
  • 925
  • 2
  • 10
  • 24