@JvmDefault is only supported since JVM target 1.8. Recompile with '-jvm-target 1.8’

问题

Logcat 提示’@JvmDefault’ is only supported since JVM target 1.8. Recompile with '-jvm-target 1.8’

解决

在gradle中插入以下代码

android {
   //..其他代码...

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

问题

Logcat 提示:Usage of ‘@JvmDefault’ is only allowed with -Xjvm-default option

解决

加入:'-Xjvm-default', 'enable'

    kotlinOptions {
        jvmTarget = "1.8"
        freeCompilerArgs += [
                '-Xjvm-default', 'enable'
        ]
    }

(325条消息) ‘@JvmDefault‘ is only supported since JVM target 1.8. Recompile with ‘-jvm-ta_普通网友的博客-CSDN博客

(325条消息) Android源码里引用 Kotlin 错误-CSDN博客

posted @ 2023-04-25 09:33  xiaowang_lj  阅读(46)  评论(0编辑  收藏  举报