https://kotlinlang.org logo
#android
Title
# android
a

alexey.tsvetkov

04/27/2017, 2:13 PM
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

deviant

04/27/2017, 2:24 PM
still same error
Copy code
project.afterEvaluate {
    compileKotlin {
        kotlinOptions {
            suppressWarnings = true
            
        }
    }
}
a

alexey.tsvetkov

04/27/2017, 3:51 PM
Are you sure that this task even exists (
./gradlew tasks
)? On Android tasks are named "compile<VARIANT_NAME>Kotlin".
@deviant