Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.

编程入门 行业动态 更新时间:2024-10-11 01:19:53

Module was compiled with an <a href=https://www.elefans.com/category/jswz/34/1768465.html style=incompatible version of Kotlin. The binary version of its metadata is 1."/>

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 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.
 

> 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.

解决方法如下:

项目根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'}}
}

项目module中的build.gradle

如app下的build.gradle

targetSdkVersion 30

resolutionStrategy.force 'org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10'

configurations.all {//每隔24小时检查远程依赖是否存在更新
//    resolutionStrategy.cacheChangingModulesFor 24, 'hours'//每隔10分钟..//resolutionStrategy.cacheChangingModulesFor 10, 'minutes'resolutionStrategy.cacheChangingModulesFor 0, 'seconds'// 采用动态版本声明的依赖缓存10分钟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'
}

在此做个笔记

更多推荐

Module was compiled with an incompatible version of Kotlin. The binary version o

本文发布于:2024-03-14 16:24:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1736864.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:incompatible   version   Module   compiled   metadata

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!