ursus
04/26/2021, 11:24 PM@OptIn
?Zach Klippenstein (he/him) [MOD]
04/26/2021, 11:31 PMOptIn
annotation itself maybe?ursus
04/26/2021, 11:33 PMZach Klippenstein (he/him) [MOD]
04/26/2021, 11:35 PMOptIn
annotation itself is marked as RequiresOptIn
, so typically you have gradle tell the kotlin compiler you want to optin to it. I assume that’s why your OptIn
line is yellow. I’m not sure why you’re getting error message though, although all that red code looks suspiciousursus
04/26/2021, 11:37 PMZach Klippenstein (he/him) [MOD]
04/26/2021, 11:41 PMursus
04/26/2021, 11:42 PMursus
04/26/2021, 11:47 PMtasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile).configureEach { task ->
task.kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xopt-in=kotlin.OptIn"
freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalStdlibApi"
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
}
}
this would only work for pure kotlin modules? stupid OptIn is still "yellow"; however that call site is in a android moduleZach Klippenstein (he/him) [MOD]
04/26/2021, 11:59 PMtasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile)
ursus
04/27/2021, 12:01 AM> Task :texts:impl:compileDebugKotlin
w: Class kotlin.OptIn is not an opt-in requirement marker
so not sure if this works
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { task ->
task.kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += [
"-Xopt-in=kotlin.OptIn",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
]
}
}
ursus
04/27/2021, 12:13 AMAnnotation 'androidx.camera.core.ExperimentalGetImage' is not an opt-in requirement marker, therefore its usage in @OptIn is ignored
so the original issue standsursus
04/27/2021, 12:19 AM@Retention(CLASS)
@Experimental
public @interface ExperimentalUseCaseGroup {
}
should it not contain @RequiresOptIn(message = "This API is ?
Zach Klippenstein (he/him) [MOD]
04/27/2021, 12:21 AMExperimental
-> RequiresOptIn
, and I think OptIn
used to be called UseExperimental
? That was changed so long ago I forgetursus
04/27/2021, 12:34 AMursus
04/27/2021, 12:34 AM