Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Kotlin DSL and freeCompilerArgs

On one project I have used sucesfully argument -XXLanguage:-ProperCheckAnnotationsTargetInTypeUsePositions in kotlinOptions to disable "typeUsage" check on annotations. This project has regular build.gradle in Groovy. However when I have used exactly same approach on same version of Kotlin (1.6.0) in fresh project with Kotlin DSL gradle files (build.gradle.kts) it seems like this argument is ignored totally.

Summarizing:

  • project with good-old Groovy gradle -> argument works and disable error on "wrong usage of annotations"
  • project with new Kotlin DSL gradle -> argument seems to be ignored and still produces error

Maybe someone has same issue? This is connected with Compatibility of android annotations with Kotlin 1.6.0

like image 372
masztalski Avatar asked Oct 14 '25 16:10

masztalski


1 Answers

kotlinOptions {
    jvmTarget = "1.8"
    freeCompilerArgs = listOf("-XXLanguage:-ProperCheckAnnotationsTargetInTypeUsePositions")
}
like image 197
Utif Milkedori Avatar answered Oct 17 '25 05:10

Utif Milkedori