1

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.

After adding a module to my project I started getting this error message. I have tried looking it up online but the suggestions have not fixed it.

Here are my buildscript and plugins.

buildscript {
    ext {
        compose_version = '1.1.0-beta01'
    }
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.5.31' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

I tried this but it did not work

buildscript {
    ext {

        kotlinVersion = "1.5.1"
        compose_version = '1.1.0-beta01'
    }
}

1 Answers1

0

Change ext.kotlinVersion to 1.7.20. I had this issue last week and this did it for me.

ext {
   kotlinVersion = "1.7.20"
}
ToxicFlame427
  • 355
  • 2
  • 13