티스토리 뷰
[안드로이드 공부]/코틀린
Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option
코코모모 2023. 6. 14. 09:30아래는 코모스튜디오가 직접 만든 무료 앱이에요
(한 번만 봐주세요 ^^)
Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option
viewModel 에 param을 추가하였더니 viewModel Factory가 필요하고, 추가 하니 위와 같은 에러가 나왔다~ 버전 충돌 문제인데~
build.gradle.app 에
kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += [
'-Xjvm-default=enable'
]
}
또는
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += [
"-Xjvm-default=all",
]
}
}
요렇게 추가만 해주면 된다.
' [안드로이드 공부] > 코틀린' 카테고리의 다른 글
android worker ClassNotFoundException (0) | 2020.09.01 |
---|---|
null cannot be cast to non-null type androidx.appcompat.widget.appcompatimagebutton (0) | 2020.08.22 |
smart cast to is impossible because is a mutable property that could have been changed by this time (0) | 2020.08.07 |
[MVVM] LiveData와 ViewModel Observer로 연결 (0) | 2020.08.07 |
코틀린 생성자와 위임 (0) | 2020.07.27 |
모든 게시물은 코모스튜디오의 소유이며, 무단 복제 수정은 절대 불가입니다. |
퍼가실 경우 댓글과 블로그 주소를 남기고 해당 게시물에 출처를 명확히 밝히세요. |
댓글
공지사항
최근에 올라온 글