Warnings as Errors
The allWarningsAsErrors property instructs the Kotlin compiler to treat every compiler warning as a hard error, causing the build to fail if any warnings are present.
Default
allWarningsAsErrors is disabled by default (false) in Kreate.
Configuration
kreate {
platform {
allWarningsAsErrors = true
}
}
Behavior
When enabled, any Kotlin compiler warning — including deprecation notices, unused variable warnings, and unchecked cast warnings — will cause the compilation task to fail with an error.
This is enforced by passing -Werror to the Kotlin compiler options for all compilation tasks in the module.
Example Output
e: file.kt:12:5: 'foo' is deprecated. Use 'bar' instead.
25 April 2026