I keep getting "This class can only be used with t...
# compose
c
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
-opt-in vs -Xopt-in, look at the error message
Think it changed in 1.6
a
If you are adding that to your root project, I think you need to put it in a
subprojects { }
block.
❤️ 1
c
That did the trick. thank you!
👍 1