[여러가지 시도]/코틀린 트러블슈팅 (에러)

[트러블슈팅] 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.

시간 확보러 2022. 10. 30. 22:18
728x90

함수를 이용한 계산기앱을 만들던 중,

갑자기 에러가 발생했다.

 

C:/Users/JEONG/.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.

 

대략 해석하면 버젼이 맞지 않다는 건데....뭘 어떻게 해야할지 난감했다.

 

구글을 찾아보니 아래의 링크에서 설명하듯이 코틀린 최신버젼으로 하면 된다고 해서

https://cishome.tistory.com/230

 

project 단위 build.gradle 에서 id ;org.jetbrains.kotline.android' version '1.5.31' apply false

'1.5.31'을 현재기준 최신버젼인 1.7.0으로 수정해서 Run을 했는데...

 

다시 또 아래와 같이 에러가 떴다.

Caused by: org.gradle.api.GradleException: Compilation error. See log for more details

 

이것도 확인해 보니 코틀린 버젼과 호환되는 compose _versiondl이 있다고 해서 아래의 링크에서 확인을 하였고

호환되는 '1.2.0'으로 수정하여 Run을 하니 정상작동을 했다.

https://developer.android.com/jetpack/androidx/releases/compose-kotlin

 

728x90