Book Image

Gradle for Android

By : Kevin Pelgrims
Book Image

Gradle for Android

By: Kevin Pelgrims

Overview of this book

Table of Contents (16 chapters)
Gradle for Android
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Ignoring Lint


When you execute a release build with Gradle, a Lint check will be performed on your code. Lint is a static code analysis tool that flags potential bugs in your layouts and Java code. In some cases, it might even block the build process. If you have not used Lint on your project before, and you want to migrate to Gradle, Lint might come up with a lot of errors. To at least make the build work, you can configure Gradle to ignore Lint errors and prevent them from aborting the build, by disabling abortOnError. This should only be a temporary solution, because ignoring Lint errors can result in issues like missing translations, which can cause the app to crash. To prevent Lint from blocking the build process, disable abortOnError like this:

android {
    lintOptions {
        abortOnError false
    }
}

Temporarily disabling the Lint abort can make it easier to migrate an existing Ant build process to Gradle. Another way to make the transition smoother is to execute Ant tasks directly...