The error message is as follows:
> Task :app:lintVitalAnalyzeRelease
e:D:/work/repository/sample/app/build/.transforms/aa3e5b20bbf5695729bf34a4f5d4a0c7/transformed/out/jars/classes.jar!/META-INF/uploadlog_release.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.
e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.7.10/d70d7d2c56371f7aa18f32e984e3e2e998fe9081/kotlin-stdlib-jdk8-1.7.10. 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.7.1, expected version is 1.5.1.
e: C:/Users/user/.gradle/caches/transforms-3/30d98ba24e9c4d46ffaa39af5f5ad345/transformed/jetified-common-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/common_release.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.
e: C:/Users/user/.gradle/caches/transforms-3/0d04137317a24900a05c1f52b4eed2b5/transformed/jetified-component-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/component_release.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.
e: C:/Users/user/.gradle/caches/transforms-3/6c3936634e94d9626acaf5a52253ec68/transformed/jetified-dialog-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/dialog_release.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.
e: C:/Users/user/.gradle/caches/transforms-3/28d65e7fec310e78c883929aecba7885/transformed/jetified-lottie-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/lottie_release.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.
e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.7.10/1ef73fee66f45d52c67e2aca12fd945dbe0659bf/kotlin-stdlib-jdk7-1.7.10. 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.7.1, expected version is 1.5.1.
e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.7.10/d2abf9e77736acc4450dc4a3f707fa2c10f5099d/kotlin-stdlib-1.7.10.jar!/META -INF/kotlin-stdlib.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.
e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.7.10/bac80c520d0a9e3f3673bc2658c6ed02ef45a76a/kotlin-stdlib-common-1.7.10. 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.
> Task :app:lintVitalAnalyzeRelease e:D:/work/repository/sample/app/build/.transforms/aa3e5b20bbf5695729bf34a4f5d4a0c7/transformed/out/jars/classes.jar!/META-INF/uploadlog_release.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. e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.7.10/d70d7d2c56371f7aa18f32e984e3e2e998fe9081/kotlin-stdlib-jdk8-1.7.10. 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.7.1, expected version is 1.5.1. e: C:/Users/user/.gradle/caches/transforms-3/30d98ba24e9c4d46ffaa39af5f5ad345/transformed/jetified-common-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/common_release.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. e: C:/Users/user/.gradle/caches/transforms-3/0d04137317a24900a05c1f52b4eed2b5/transformed/jetified-component-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/component_release.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. e: C:/Users/user/.gradle/caches/transforms-3/6c3936634e94d9626acaf5a52253ec68/transformed/jetified-dialog-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/dialog_release.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. e: C:/Users/user/.gradle/caches/transforms-3/28d65e7fec310e78c883929aecba7885/transformed/jetified-lottie-2023.09.28-SNAPSHOT/jars/classes.jar!/META-INF/lottie_release.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. e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.7.10/1ef73fee66f45d52c67e2aca12fd945dbe0659bf/kotlin-stdlib-jdk7-1.7.10. 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.7.1, expected version is 1.5.1. e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.7.10/d2abf9e77736acc4450dc4a3f707fa2c10f5099d/kotlin-stdlib-1.7.10.jar!/META -INF/kotlin-stdlib.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. e: C:/Users/user/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.7.10/bac80c520d0a9e3f3673bc2658c6ed02ef45a76a/kotlin-stdlib-common-1.7.10. 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.
The solution is as follows:
Project root build.gradle:
classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10”
buildscript { repositories {...} dependencies { classpath "com.android.tools.build:gradle:7.1.3" //classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10" } }
resolutionStrategy {
force ‘org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10’
}
allprojects { repositories {...} configurations.all { resolutionStrategy { force 'org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10' } } }
build.gradle in project module
Such as build.gradle under app
targetSdkVersion 30
resolutionStrategy.force ‘org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10’
configurations.all { //Check whether remote dependencies are updated every 24 hours // resolutionStrategy.cacheChangingModulesFor 24, 'hours' //Every 10 minutes.. //resolutionStrategy.cacheChangingModulesFor 10, 'minutes' resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // Use dynamic version declaration to cache dependencies for 10 minutes resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds' resolutionStrategy.force 'org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10' } dependencies { implementation 'androidx.core:core-ktx:1.3.2' implementation 'androidx.appcompat:appcompat:1.6.0-alpha01' }
Make a note here