When `kotlin-android` is used, the tasks are not a...
# android
a
When
kotlin-android
is used, the tasks are not available during script evaluation. You can refer to
compileKotlin
in
project.afterEvaluate { compileKotlin }
. On the other hand if you want to set
suppressWarnings
for the whole project, you can just use
kotlinOptions
extension in
android
block.
Copy code
android {
     kotlinOptions.suppressWarnings = true
}
👍 1
d
still same error
Copy code
project.afterEvaluate {
    compileKotlin {
        kotlinOptions {
            suppressWarnings = true
            
        }
    }
}
a
Are you sure that this task even exists (
./gradlew tasks
)? On Android tasks are named "compile<VARIANT_NAME>Kotlin".
@deviant