This question explains what the "safeUnbox warning" is.
I have the following in my build.gradle:
lintOptions {
quiet false
abortOnError true
warningsAsErrors true
baseline file("lint-baseline.xml")
}
and later:
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
jvmTarget = "1.8"
allWarningsAsErrors = true
}
}
But data-binding safeUnbox warnings don't fail the build process. The output has complains about warnings and that warnings was turned to errors:
w: warning: viewModel.doorsState.getValue().first is a boxed field but needs to be un-boxed to execute android:text. This may cause NPE so Data Binding will safely unbox it. You can change the expression and explicitly wrap viewModel.doorsState.getValue().first with safeUnbox() to prevent the warning
file:///.../app/src/debug/res/layout/activity_car_connection_debug.xml Line:75
e: warnings found and -Werror specified
But at the very end of the building process I have:
BUILD SUCCESSFUL in 46s
Is there any way to make the whole build process unsuccessful upon "safeUnbox warning"?