728x90
반응형
몇일 전까지만 해도 잘 빌드하고 있던 프로젝트를 다시 빌드하는 도중에 아래와 같은 에러가 발생하였다.
손댄게 없는데 왜 이러지??
(물론 중간에 다른 Flutter 버전의 프로젝트를 손댄것도 있고 빌드환경을 여러번 변경하면서 뭔가가 바뀌었을수도 있다... ㅎ.ㅎ;;)
FVM을 사용하고 있기에 빌드 환경이 달라질것은 없었을건데..
분명 확실한건 코드가 변경된적은 없다는거다.
하지만 시뻘건 Execution failed for task ':app:compileDebugKotlin'. 에러는
나로 하여금 부아가 치밀어오르게 하였다.
e: /Users/hercules/.gradle/caches/transforms-2/files-2.1/0a8b6acd7511bb68f51a990622cf3203/jetified-kotlin-stdlib-jdk8-1.6.0.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.6.0, expected version is 1.4.2.
e: /Users/hercules/.gradle/caches/transforms-2/files-2.1/0c327f6414a50d24bc60628d8da3464c/jetified-kotlin-stdlib-jdk7-1.6.0.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.6.0, expected version is 1.4.2.
e: /Users/hercules/.gradle/caches/transforms-2/files-2.1/3bdf11e86ab5e5c90cb634555a2a67da/jetified-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.4.2.
e: /Users/hercules/.gradle/caches/transforms-2/files-2.1/c943383bea821472a8db76abf362a788/jetified-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.4.2.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> 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 47s
Exception: Gradle task assembleDebug failed with exit code 1
에러의 주요 내용은 아래와 같고,
모듈이 호환되지 않는 코틀린 버전으로 컴파일되었다는 내용이다.
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.
결국 구글에 관련 글을 찾아보다 에러 텍스트에서도 언급되어 있듯이 버전 이슈라는것을 것을 확인하였고
아래와 같이 코틀린 버전을 변경함으로써 간단히 해결하였다.
* 변경 사항 :
ext.kotlin_version = '1.5.0'
buildscript {
ext.kotlin_version = '1.5.0' << '1.4.31'에서 변경
repositories {
google()
jcenter()
maven {
url "https://maven.appspector.com/artifactory/android-sdk"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
classpath "com.appspector:android-sdk-plugin:1.+"
}
}
728x90
반응형
'Development > Flutter' 카테고리의 다른 글
[플러터 위젯] iOS widget에서 버튼 사용하기 (0) | 2022.07.07 |
---|---|
[해결방법] 문제1. The MinCompileSdk (31) specified in, 문제2. The binary version of its metadata is 1.5.1, expected version is 1.1.15. (0) | 2022.05.06 |
[해결방법] Vertical viewport was given unbounded height (0) | 2022.04.25 |
[해결방법] warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0 (0) | 2022.04.15 |
[해결방법] Flutter CORS 에러 없애기 (0) | 2021.12.31 |