Notice
Recent Posts
Recent Comments
Link
고갱
[Flutter] compileDebugKotlin 오류 해결 본문
❗오류 발생
Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
e: C:/Users/이름/.gradle/caches/transforms-3/1883941d2759c467b016d46a917ad5be/transformed/jetified-kotlin-stdlib-1.9.24.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.9.0, expected version is 1.7.1.
e: C:/Users/이름/.gradle/caches/transforms-3/1883941d2759c467b016d46a917ad5be/transformed/jetified-kotlin-stdlib-1.9.24.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.9.0, expected version is 1.7.1.
e: C:/Users/이름/.gradle/caches/transforms-3/1883941d2759c467b016d46a917ad5be/transformed/jetified-kotlin-stdlib-1.9.24.jar!/META-INF/kotlin-stdlib.kotlin_module: 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.
e: C:/Users/이름/.gradle/caches/transforms-3/c1bf03c31e3167f7272950769245b854/transformed/jetified-annotation-jvm-1.9.1.jar!/META-INF/annotation.kotlin_module: 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.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s

오늘은 Flutter 앱 개발 도중 compileDebugKotlin 컴파일 오류가 발생했던 것을 해결하였다.
사실 빈 프로젝트를 만들고 테스트 삼아 빌드를 누른건데도 오류가 나니까 의아했다.
오류 내용도 읽어보니 어려운 점은 없었다.
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.
마지막에 적힌 이 부분만 제대로 보면 단순 코틀린 버전 불일치다.
그렇다면 해야할 점은 당연히 Kotlin 버전 변경일 것으로 보였다.
🤔 해결법
바로 해결하기 위해 settings.gradle 파일을 열어보니 아래 사진처럼 문제가 되는 부분이 보였다.

1.7.10 으로 되어있는 부분을 오류 내용과 같이 메타데이터 바이너리 버전인 1.9.0 으로 바꿔주고 빌드를 눌러준다.

그러면 아래처럼 문제 없이 빌드되고 핸드폰으로 실행되는 모습을 볼 수 있다.

'앱 개발 > Flutter' 카테고리의 다른 글
| [Flutter] minSdkVersion 오류 해결 (0) | 2024.11.08 |
|---|---|
| [Flutter] 공무원 공무 처리 서비스 개발 #3 (0) | 2024.11.07 |
| [Flutter] 공무원 공무 처리 서비스 개발 #2 (0) | 2024.11.06 |
| [Flutter] 공무원 공무 처리 서비스 개발 (0) | 2024.11.02 |
| [Flutter] 졸업 작품 제작 (0) | 2024.11.01 |
