https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

01/14/2022, 4:10 PM
I keep getting "This class can only be used with the compiler argument '-opt-in=kotlin.RequiresOptIn'" when building. I see that this can be fixed with
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
  kotlinOptions {
    freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
  }
}
which I added to my root build.gradle, but I still get the warning. Should I just not care or should I just remove it completely?
t

Thomas

01/14/2022, 5:13 PM
-opt-in vs -Xopt-in, look at the error message
Think it changed in 1.6
a

Albert Chang

01/15/2022, 4:24 AM
If you are adding that to your root project, I think you need to put it in a
subprojects { }
block.
❤️ 1
c

Colton Idle

01/17/2022, 7:05 AM
That did the trick. thank you!
👍 1
6 Views