title: Gradle project sync failed - Gradle DSL method not found: android()
body: <p>i imported a project that uses roboelectric but it seems that build.gradle file is wrong and i do not know how to fix it. I've checked i have gradle 2.2.1 but i've not figured out the problem yet... My log:</p>
  
  <pre><code>Executing tasks: [:]
  
  Configuration on demand is an incubating feature.
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file '/Users/dev1/Desktop/DESARROLLO/AndroidTestExample-master/Starter/build.gradle' line: 3
  
  * What went wrong:
  A problem occurred evaluating root project 'Starter'.
  &gt; Could not find method android() for arguments [build_43aogzm0wm94eieabvjhdztqe$_run_closure1@eed01a1] on root project 'Starter'.
  
  * 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: 0.153 secs
  </code></pre>
  
  <p>And the build.gradle:       </p>
  
  <pre><code>buildscript {
  repositories {
      mavenCentral()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:1.2.3'
  }
  }
  apply plugin: 'android'
  sourceSets {
      unitTest {
          java.srcDir file('src/test/java')
          resources.srcDir file('src/test/res')
          }
  }
  
  configurations {
  unitTestCompile.extendsFrom runtime
  unitTestRuntime.extendsFrom unitTestCompile
   }
  
  dependencies {
  repositories {
      mavenCentral()
  }
      unitTestCompile files("$project.buildDir/classes/release")
  unitTestCompile 'junit:junit:4.10'
  unitTestCompile 'org.robolectric:robolectric:2.1.+'
  unitTestCompile 'com.google.android:android:4.0.1.2'
  }
  task unitTest(type:Test, dependsOn: assemble) {
      testClassesDir = project.sourceSets.unitTest.output.classesDir
      classpath = project.sourceSets.unitTest.runtimeClasspath
  }
  check.dependsOn unitTest
  
  android {
  compileSdkVersion 19
  buildToolsVersion "19.0.0"
  </code></pre>
  
  <p>}</p>