pancodemakes
pancodemakes

Reputation: 574

Why is my Travis-CI build still failing?

For the last four builds, all of them have failed but I can not figure out why. It is giving me an error, but when I check the code in my IDE (Android Studio), I have no errors, but just warnings. Is it interpreting the warnings as errors? Here is the error given by the log:

Lint found 1 errors and 6 warnings
:mobile:lint FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mobile:lint'.
> Lint found errors in the project; aborting build.

Upvotes: 0

Views: 703

Answers (1)

Nikola Despotoski
Nikola Despotoski

Reputation: 50548

This is because your gradle is configured to fail the build if your code does not match LINT rules.

You can do any of the following attempts:

  1. Fix everything in your code that LINT complains about (Most recommended)

  2. Silence the lint by setting quiet mode or abortOnError to false:


lintOptions {
        quiet true
        checkReleaseBuilds false
        // if true, stop the gradle build if errors are found
        abortOnError false
    } 

  1. Disable all gradle tasks that start with lint at the beginning of your tasks


tasks.whenTaskAdded { task ->
    if (task.name.equals("lint")) {
        task.enabled = false
    }
} 

  1. Run the build task with -x lint argument like: gradlew assemble -x lint

Upvotes: 1

Related Questions