Search code examples
androidgradlebuild.gradlelintgradlew

Continue build with lint warnings


I have a build.gradle file for an android project.It says

android {
lintOptions {      
   quiet false
   abortOnError true
   ignoreWarnings true
   }
   ...
}

My requirement is like it should get aborted only if there are errors. If warnings are present just continue with the build.How can we do that?

Also I tried running the lint from command line as

lint path-to-project

This gives an error To correctly analyze Gradle projects, you should run "gradlew :lint" instead. Please help me to resolve this also.


Solution

  • try adding checkReleaseBuilds inside lintoptions

    Like this

    lintOptions {
        checkReleaseBuilds false
    }
    

    Second issue can be resolved using following commands

    cd PATH_TO_PROJECT
    chmod a+x gradlew
    ./gradlew lint
    

    This will work.