title: How to disable lint abortOnError in Android Gradle Plugin from top level of multi project directory
body: <p>I have a top level Android Gradle project. There are multiple subprojects nested below this projects (sometimes they are 2 level deep) i.e:</p>
  
  <pre><code>top level project
     |
  project1
  
  vendor libraries
        |
       lib1
  
       lib2
  </code></pre>
  
  <p>lint is aborting my build in some of the libraries projects. I can edit each individual library project's <code>build.gradle</code> to fix the problem with</p>
  
  <pre><code>android {
     lintOptions {
        abortOnError false
     }
  }
  </code></pre>
  
  <p>However, I would prefer the following code in the top level <code>build.gradle</code> script:</p>
  
  <pre><code>subprojects {
  
      afterEvaluate {
          if (getPlugins().hasPlugin('android') ||
              getPlugins().hasPlugin('android-library')) {
  
              println name // for debugging
  
              android {
                  lintOptions {
                      abortOnError false
                  }
              }
          }
  
      }
  }
  </code></pre>
  
  <p>The conditional statement makes sure to hook only into projects with an android plugin. I could only get this to work using afterEvaluate. However, my build is still failing on lint errors.</p>
  
  <p>Does anyone have have a clean solution to inject these settings from the top level?</p>
  
  <p>UPDATE:</p>
  
  <p>Rearranging the subprojects and afterEvaluate or using allprojects still gives the same following kind of error:</p>
  
  <pre><code>7: Task failed with an exception.
  -----------
  * What went wrong:
  Execution failed for task ':3rdparty:OrmLiteQueryBuilder:lint'.
  &gt; [Ljava/util/HashMap$Entry;
  
  * Try:    
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  ==============================================================================
  
  BUILD FAILED
  
  Total time: 40.528 secs
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>7: Task failed with an exception.
  -----------
  * What went wrong:
  Execution failed for task ':3rdparty:OrmLiteQueryBuilder:lint'.
  &gt; [Ljava/util/HashMap$Entry;
  
  * Try:    
  Run with --info or --debug option to get more log output.
  
  * Exception is:
  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':3rdparty:OrmLiteQueryBuilder:lint'.
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
          at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
          at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
          at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
          at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
          at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
          at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
          at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
          at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:286)
          at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
          at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
          at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
          at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
  Caused by: java.lang.NoClassDefFoundError: [Ljava/util/HashMap$Entry;
          at com.android.build.gradle.internal.dsl.LintOptionsImpl$1.$getStaticMetaClass(LintOptionsImpl.groovy)
          at com.android.build.gradle.internal.dsl.LintOptionsImpl$1.&lt;init&gt;(LintOptionsImpl.groovy)
          at com.android.build.gradle.internal.dsl.LintOptionsImpl.syncTo(LintOptionsImpl.groovy:450)
          at com.android.build.gradle.internal.dsl.LintOptionsImpl$syncTo.call(Unknown Source)
          at com.android.build.gradle.tasks.Lint.lintAllVariants(Lint.groovy:105)
          at com.android.build.gradle.tasks.Lint$lintAllVariants.callCurrent(Unknown Source)
          at com.android.build.gradle.tasks.Lint.lint(Lint.groovy:63)
          at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
          at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
          at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
          at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
          at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:530)
          at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:513)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
          ... 13 more
  Caused by: java.lang.ClassNotFoundException: java.util.HashMap$Entry
          ... 28 more
  
  ==============================================================================
  
  BUILD FAILED
  
  Total time: 2 mins 20.757 secs
  </code></pre>
  
  <p>I can run <code>gradle build</code> successfully with the <code>-x lint</code> option but want to build without using the commandline options.</p>