Module was compiled with an incompatible version of Kotlin

Hi, I am working on android studio project and this error keeps showing. I have synced project with gradle file but doesn’t work.

e: /Users/aimeel/.gradle/caches/transforms-3/a18e86742e01f373d28c7f0b41fd2e27/transformed/jetified-kotlin-stdlib-1.9.22.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: /Users/aimeel/.gradle/caches/transforms-3/a18e86742e01f373d28c7f0b41fd2e27/transformed/jetified-kotlin-stdlib-1.9.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: /Users/aimeel/.gradle/caches/transforms-3/a18e86742e01f373d28c7f0b41fd2e27/transformed/jetified-kotlin-stdlib-1.9.22.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: /Users/aimeel/.gradle/caches/transforms-3/a9b0232f4527e5bfb06ec29228a49c3a/transformed/jetified-play-services-measurement-api-21.6.2-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:compileDebugKotlin’.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

This is my --scan result.
https://gradle.com/s/2ebahjve72utg

The build scan is not too useful as it is not if the failing build.
But anyway this is not really a Gradle topic. You try to use a Kotlin 1.9 compiled library while compiling with Kotlin 1.7, this does not work.

Hi, I know it’s not a gradle topic but do you know how to solve the error? I have changed the Kotlin compiler version but still doesn’t work.

I can only guess that you did not do it correctly.
You either cannot use what was compiled with Kotlin 1.9 when compiling with 1.7, or need to compile with newer than 1.7.