标题: 【错误记载】Android Studio 中 Kotlin 版本报错 ( Module was compiled wi [打印本页] 作者: tsx81429 时间: 2024-6-15 00:43 标题: 【错误记载】Android Studio 中 Kotlin 版本报错 ( Module was compiled wi 一、报错信息
Module was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 1.6.0, expected version is 1.1.13.
复制代码
这个报错问题 , 出现了十几次 ;
详细报错信息如下 : 下面的报错信息 , 仅做参考 , 就不要点开了 ;
> Task :app:compileDebugKotlin FAILEDw: Runtime JAR files in the classpath should have the same version. These files were found in the classpath: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5) C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.30/525f5a7fa6d7790a571c07dd24214ed2dda352fe/kotlin-stdlib-jdk7-1.5.30.jar (version 1.5) C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar (version 1.6) C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.0/7857e365f925cfa060f941c1357cda1f8790502c/kotlin-stdlib-common-1.6.0.jar (version 1.6)w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpathe: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errorse: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.0/7857e365f925cfa060f941c1357cda1f8790502c/kotlin-stdlib-common-1.6.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.6.0, expected version is 1.1.13.
e: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.30/525f5a7fa6d7790a571c07dd24214ed2dda352fe/kotlin-stdlib-jdk7-1.5.30.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.5.1, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.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.5.1, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.Runtime JAR files in the classpath should have the same version. These files were found in the classpath: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5) C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.30/525f5a7fa6d7790a571c07dd24214ed2dda352fe/kotlin-stdlib-jdk7-1.5.30.jar (version 1.5) C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar (version 1.6) C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.0/7857e365f925cfa060f941c1357cda1f8790502c/kotlin-stdlib-common-1.6.0.jar (version 1.6)e: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-android/1.5.2/d246a704a55b7bddb79407cce4348890eaa341d9/kotlinx-coroutines-android-1.5.2.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.5.2/f4cc07a50437659e0043e7da762809a46932b6a0/kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/2d2e05a2754ff6e110d0373147158883/transformed/navigation-fragment-2.4.1-api.jar!/META-INF/navigation-fragment_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/META-INF/navigation-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/98a12fce22bb35efa781271d8241e273/transformed/core-ktx-1.7.0-api.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/a30274fc0e0526fe1ef8c0b3cd696552/transformed/fragment-ktx-1.4.1-api.jar!/META-INF/fragment-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/b3e72646352669a2c158a12247e912da/transformed/slidingpanelayout-1.2.0-api.jar!/META-INF/slidingpanelayout_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/b812a08bf56bf9d544c39f2d2daffce7/transformed/navigation-ui-2.4.1-api.jar!/META-INF/navigation-ui_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/bbf2426cb1f6c0ebbc959e0eb199649d/transformed/fragment-1.4.1-api.jar!/META-INF/fragment_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.e: C:/Users/octop/.gradle/caches/transforms-3/d12e05eecb6d4d83cbc249be744f1fb1/transformed/navigation-common-2.4.1-api.jar!/META-INF/navigation-common_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.e: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (9, 28): Class 'androidx.navigation.Navigation' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/Navigation.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (18, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (30, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (32, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (34, 41): Unresolved reference: applye: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (36, 22): Unresolved reference: putStringe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (37, 22): Unresolved reference: putInte: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (41, 33): Class 'androidx.navigation.Navigation' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/Navigation.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (41, 44): Class 'androidx.navigation.NavController' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/NavController.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (43, 13): Class 'androidx.navigation.NavController' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/NavController.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentA.kt: (43, 27): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (10, 28): Class 'androidx.navigation.Navigation' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/Navigation.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (21, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.0/7857e365f925cfa060f941c1357cda1f8790502c/kotlin-stdlib-common-1.6.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.6.0, expected version is 1.1.13.
The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (22, 20): Unresolved reference: lete: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (23, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (23, 20): Unresolved reference: ite: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (24, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (24, 19): Unresolved reference: ite: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (39, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (41, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (48, 33): Class 'androidx.navigation.Navigation' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/Navigation.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (48, 44): Class 'androidx.navigation.NavController' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/NavController.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (50, 13): Class 'androidx.navigation.NavController' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/NavController.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\FragmentB.kt: (50, 27): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.class
Class 'androidx.navigation.Navigation' was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 1.6.0, expected version is 1.1.13.
The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/Navigation.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (6, 31): Class 'androidx.navigation.ui.NavigationUI' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/b812a08bf56bf9d544c39f2d2daffce7/transformed/navigation-ui-2.4.1-api.jar!/androidx/navigation/ui/NavigationUI.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (10, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.30/525f5a7fa6d7790a571c07dd24214ed2dda352fe/kotlin-stdlib-jdk7-1.5.30.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.5.1, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (11, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (15, 29): Class 'androidx.navigation.NavController' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/NavController.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (16, 9): Class 'androidx.navigation.ui.NavigationUI' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/b812a08bf56bf9d544c39f2d2daffce7/transformed/navigation-ui-2.4.1-api.jar!/androidx/navigation/ui/NavigationUI.classC:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.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.5.1, expected version is 1.1.13.C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.e: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (16, 22): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-android/1.5.2/d246a704a55b7bddb79407cce4348890eaa341d9/kotlinx-coroutines-android-1.5.2.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (16, 22): Class 'androidx.navigation.NavController' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.5.2/f4cc07a50437659e0043e7da762809a46932b6a0/kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/NavController.classC:/Users/octop/.gradle/caches/transforms-3/2d2e05a2754ff6e110d0373147158883/transformed/navigation-fragment-2.4.1-api.jar!/META-INF/navigation-fragment_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.e: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (16, 22): Class 'androidx.navigation.ui.AppBarConfiguration' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/META-INF/navigation-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/transforms-3/98a12fce22bb35efa781271d8241e273/transformed/core-ktx-1.7.0-api.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/b812a08bf56bf9d544c39f2d2daffce7/transformed/navigation-ui-2.4.1-api.jar!/androidx/navigation/ui/AppBarConfiguration.classe: D:\002_Project\002_Android_Learn\Navigation\app\src\main\java\kim\hsl\nav\MainActivity.kt: (16, 60): Class 'androidx.navigation.NavController' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/transforms-3/a30274fc0e0526fe1ef8c0b3cd696552/transformed/fragment-ktx-1.4.1-api.jar!/META-INF/fragment-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.The class is loaded from C:/Users/octop/.gradle/caches/transforms-3/7c8d0ea965780acf266bbf51684cf083/transformed/navigation-runtime-2.4.1-api.jar!/androidx/navigation/NavController.classC:/Users/octop/.gradle/caches/transforms-3/b3e72646352669a2c158a12247e912da/transformed/slidingpanelayout-1.2.0-api.jar!/META-INF/slidingpanelayout_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/transforms-3/b812a08bf56bf9d544c39f2d2daffce7/transformed/navigation-ui-2.4.1-api.jar!/META-INF/navigation-ui_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.C:/Users/octop/.gradle/caches/transforms-3/bbf2426cb1f6c0ebbc959e0eb199649d/transformed/fragment-1.4.1-api.jar!/META-INF/fragment_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.C:/Users/octop/.gradle/caches/transforms-3/d12e05eecb6d4d83cbc249be744f1fb1/transformed/navigation-common-2.4.1-api.jar!/META-INF/navigation-common_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.13.
复制代码
二、问题分析
核心报错信息如下 :
Module was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 1.6.0, expected version is 1.1.13.
The class is loaded from C:/Users/octop/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.0/a40b8b22529b733892edf4b73468ce598bb17f04/kotlin-stdlib-1.6.0.jar!/kotlin/Unit.class
Class 'androidx.navigation.Navigation' was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 1.6.0, expected version is 1.1.13.
复制代码
分析上述错误 :
Class ‘androidx.navigation.Navigation’ was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 1.6.0, expected version is 1.1.13.
类的androidx.navigation。“导航”是用不兼容的Kotlin版本编译的。
其元数据的二进制版本为1.6.0,预期版本为1.1.13。
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
复制代码
插件的依靠 ; 完备的代码如下 :
// 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.7.20' apply false
id 'androidx.navigation.safeargs' version '2.3.0-alpha06' apply false}