title: How do I suppress warnings when compiling an android library with gradle?
body: <p>In my application I have a library developed by a 3rd party that unfortunately contains quite a few lint and javac warnings. I'd like to ignore both these types of warnings since they can't be fixed by our team and they are polluting our build logs. I have tried adding the following to the libraries build.gradle file:</p>
  
  <p><strong>In the android block</strong></p>
  
  <pre><code>lintOptions {
      ignoreWarnings = true
  }
  </code></pre>
  
  <p>I also added the following to the end of the build.gradle file:</p>
  
  <pre><code>afterEvaluate {
      tasks.withType(JavaCompile) {
           it.options.compilerArgs &lt;&lt; "-Xlint:none" &lt;&lt; "-nowarn"
      }
  }
  </code></pre>
  
  <p>Unfortunately, whenever ":compileDebugJavaWithJavac" runs, it still outputs the warnings from this project. What am I doing wrong?</p>
  
  <p><strong>EDIT</strong>
  Here is the build.gradle file in its entirety </p>
  
  <pre><code>apply plugin: 'com.android.library'
  
  dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
  }
  
  android {
      compileSdkVersion 21
      buildToolsVersion "23.0.2"
  
      lintOptions {
         abortOnError false        // true by default
         checkAllWarnings false
         checkReleaseBuilds false
         ignoreWarnings true       // false by default
         quiet true                // false by default
      }
  
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              resources.srcDirs = ['src']
              aidl.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
  
          // Move the tests to tests/java, tests/res, etc...
          instrumentTest.setRoot('tests')
  
          // Move the build types to build-types/&lt;type&gt;
          // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
          // This moves them out of them default location under src/&lt;type&gt;/... which would
          // conflict with src/ being used by the main source set.
          // Adding new build types or product flavors should be accompanied
          // by a similar customization.
          debug.setRoot('build-types/debug')
          release.setRoot('build-types/release')
      }
  }
  
  afterEvaluate {
      tasks.withType(JavaCompile) {
           it.options.compilerArgs &lt;&lt; "-Xlint:none" &lt;&lt; "-nowarn"
      }
  }
  </code></pre>
  
  <p>The following is an example of the warnings I am getting that I want to eliminate:</p>
  
  <blockquote>
    <p>warning: [unchecked] unchecked call to isAssignableFrom(Class) as a
    member of the raw type Class
                if (type.isAssignableFrom(throwables[i].getClass()))</p>
  </blockquote>