Power gradle build failure with obsolete use

I am using Android Studio 1.5.1. I want to get a build failure if using an outdated API. Currently, I am changing the error level in the settings, but the assembly only gives me a warning. I tried to insert a gradle file:

lintOptions {
    abortOnError true
}

but that will not work. Is there any code that I can use in the gradle file or any option?

+3
source share
1 answer

In the root directory build.gradletry:

allprojects {
    tasks.withType(JavaCompile) {
        options.deprecation = true
        options.compilerArgs += ['-Werror']
    }
}

Works for me on Android Studio 2.2.

+2
source

Source: https://habr.com/ru/post/1655875/


All Articles