@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' ] }