我按照 Kotlin 文档 这里 和 这里 的说明,选择在整个模块中启用 kotlin.ExperimentalUnsignedTypes
。现在我的模块的 build.gradle
文件如下:
android {
...
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalUnsignedTypes"
}
Lint仍然抱怨ExperimentalUnsignedTypes,编译时我收到这个警告:
> Task :myModule:compileDebugKotlin
w: Flag is not supported by this version of the compiler: -Xopt-in=kotlin.ExperimentalUnsignedTypes
我的 Kotlin 版本是:1.3.61
-Xuse-experimental=...
。 - Animesh Sahu