Home > front end >  Room and Jetpack Compose may cause this error, "Module was compiled with an incompatible versio
Room and Jetpack Compose may cause this error, "Module was compiled with an incompatible versio

Time:08-13

As I introduced Jetpack Compose and Room simultaneously for a new app, my Android Studio threw this error.

/***/***/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.7.0/51736992f422993a1e741051bdf3c12801bc1ca1/kotlin-stdlib-common-1.7.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.

When I wrote codes without Room libraries, I didn't get the error. Here is what I tried to solve this problem.

  1. Upgrading Android Studio and Kotlin version

  2. Referred this page: enter image description here

    Also make sure to use same variable for kotlin gradle plugin in project build.gradle.

       classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    
  • Related