프로그래밍/Flutter

[Flutter] Module was compiled with an incompatible version of Kotlin에러 해결

Beginner:) 2023. 12. 24.
320x100

 

아래와 같은 에러가 발생

 

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

 

 

 

"아마 너의 버전이 1.7.1인데 metadata version이 1.9.0이니까 업그레이드해야 할 거 같아"라고 말하고 있다.

 

라이브러리를 설치할 때 의존성 버전이 맞지 않아 나타나는 문제인데

라이브러리 버전을 낮추거나 Kotlin version을 높여야함.

 

 

Kotlin version을 업그레이드해 본다.

Flutter 경로에서 "android\build.gradle" 파일을 열어준 뒤 에러창 말대로 "ext.kotlin_version"1.9.0으로 변경해 보자.

buildscript {
    ext.kotlin_version = '1.9.0' // [here] !!!!!!!!!!!!!!!!!
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

 

 

반응형

'프로그래밍 > Flutter' 카테고리의 다른 글

[Flutter] 첫 앱 시작하기  (0) 2023.12.22
[Flutter] VSCode에서 Flutter 환경 구축하기  (0) 2023.12.21

댓글