title: 'IllegalStateException: buildToolsVersion is not specified' on Groovy Android plugin
body: <p>I'm getting <code>'IllegalStateException: buildToolsVersion is not specified'</code> in my Gradle build on the Groovy Android plugin, the following is a (presumably) controlled test not dependent on the actual project:</p>
  
  <pre><code>$ gradle -v
  
  ------------------------------------------------------------
  Gradle 3.0
  ------------------------------------------------------------
  
  Build time:   2016-08-15 13:15:01 UTC
  Revision:     ad76ba00f59ecb287bd3c037bd25fc3df13ca558
  
  Groovy:       2.4.7
  Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
  JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
  OS:           Linux 4.2.0-42-generic amd64
  
  
  $ find .
  .
  ./build.gradle
  ./build.gradle~
  ./settings.gradle
  ./sub
  ./sub/build.gradle
  ./sub/build.gradle~
  ./settings.gradle~
  
  
  $ cat build.gradle
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          // classpath 'com.android.tools.build:gradle:2.1.3' 
          classpath 'com.android.tools.build:gradle:2.2.0-beta3'
          classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.0.0'
      }
  }
  
  
  
  $ cat sub/build.gradle
  
  apply plugin: 'com.android.application'
  //apply plugin: 'com.android.library'
  apply plugin: 'groovyx.android'
  
  android {
      compileSdkVersion 24
      buildToolsVersion "24.0.2"
  }
  
  
  
  $ cat settings.gradle
  include 'sub'
  
  
  $ cat ~/.gradle/gradle.properties
  
  org.gradle.daemon=false
  org.gradle.parallel=false
  
  
  $ rm -rf ~/.gradle/caches
  
  
  $ gradle --refresh-dependencies  tasks
  Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
  java.lang.IllegalStateException: buildToolsVersion is not specified.
          at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
          at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:645)
          at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:608)
          at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:605)
          at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
          at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:120)
          at com.android.build.gradle.BasePlugin.lambda$createTasks$1(BasePlugin.java:603)
          at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93)
          at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
          at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
          at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
          at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
          at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
          at com.sun.proxy.$Proxy11.afterEvaluate(Unknown Source)
          at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
          at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
          at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:573)
          at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:125)
          at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
          at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
          at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:124)
          at org.gradle.internal.Factories$1.create(Factories.java:22)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
          at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:121)
          at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
          at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
          at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
          at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
          at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
          at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
          at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
          at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:82)
          at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
          at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
          at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:244)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:217)
          at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33)
          at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:210)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:174)
          at org.gradle.launcher.Main.doAction(Main.java:33)
          at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
          at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file '/home/baz/data/coding/tests/gradle/sim/sub/build.gradle' line: 4
  
  * What went wrong:
  A problem occurred evaluating project ':sub'.
  &gt; Failed to apply plugin [id 'groovyx.android']
     &gt; Could not create plugin of type 'GroovyAndroidPlugin'.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  </code></pre>
  
  <p>Is there anything wrong with the build files or any compatibility issues with the plugins maybe?</p>