I followed the Kotlin documentation here and here to opt into kotlin.ExperimentalUnsignedTypes
for the whole module. My module build.gradle
looks like this now:
android {
...
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalUnsignedTypes"
}
Lint is still complaining about ExperimentalUnsignedTypes and when compiling I get this warning:
> Task :myModule:compileDebugKotlin
w: Flag is not supported by this version of the compiler: -Xopt-in=kotlin.ExperimentalUnsignedTypes
My kotlin version is: 1.3.61
As mentioned in the docs here
@RequireOptIn
and@OptIn
annotations were introduced in 1.3.70 to replace previously used@Experimental
and@UseExperimental
; at the same time,-Xopt-in
compiler option replaced-Xuse-experimental
.
@OptIn(...::class)
and use of -Xopt-in=...
were introduced in Kotlin 1.3.70, but the old and gold -Xuse-experimental
is still available in future versions (tested in Kotlin 1.4-M1).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With