private val viewModel: MyViewModel by viewModels()
复制代码
编译提示错误,如下:
Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' optio
解决方法,在 gradle
里面添加:
android {
kotlinOptions {
// work-runtime-ktx 2.1.0 and above now requires Java 8
jvmTarget = "1.8"
}
}
复制代码
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END