"Error:scalac: error while loading package, Scala signature package has wrong version expected: 5.0 found: 5.2 in package.class"

I got error :scalac: error while loading package, Scala signature package has wrong version expected: 5.0 found: 5.2 in package.class, while running a unit test in IntelliJ IDEA, if anyone knows how to remove it, please respond

You are mixing two different Scala versions.

Make sure all your dependencies are using the same Scala version and that such version is the same version of your project.

Sorry but I am not so sure how to check it, can you help a little bit more, I have done scala --version and it is showing 2.13.8, but then what to do

What build tool are you using?

Normally the Scala version is in the build settings, so it’s normally irrelevant what version scala --version reports, since the build tools don’t just use whatever installed Scala is lying around, they use the exact one the build specifies.

2 Likes