title: Cannot build Android project with Gradle (using Android Annotations)
body: <p>I'm trying to use gradle to build my Android project wit Android Annotations but I still get errors. In my java classes AA is not found. </p>
  
  <p>Also in gradle file I get some hints:</p>
  
  <p>versionName "1.0" &lt;- 'versionName' cannot be applied to '(java.lang.String)'</p>
  
  <p>'main' in 'build' cannot be applied to '(groovy.lang.Closure)'</p>
  
  <pre><code>        main {
              manifest.srcFile 'src/main/AndroidManifest.xml'
              java.srcDirs = ['src/main/java', 'GENERATED_FOLDER']
              resources.srcDirs = ['src/main/resources']
              res.srcDirs = ['src/main/res']
              assets.srcDirs = ['src/main/assets']
          }
  </code></pre>
  
  <p>Below is my full gradle script:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          // replace with the current version of the Android plugin
          classpath 'com.android.tools.build:gradle:0.9.2'
          // the latest version of the android-apt plugin
          classpath 'com.neenbedankt.gradle.plugins:android-apt:1.1'
      }
  }
  
  repositories {
      mavenCentral()
      mavenLocal()
  }
  
  apply plugin: 'android'
  apply plugin: 'android-apt'
  def AAVersion = '3.0.1'
  
  dependencies {
      // Android annotations
      apt "org.androidannotations:androidannotations:$AAVersion"
      compile "org.androidannotations:androidannotations-api:$AAVersion"
  
      compile 'com.android.support:appcompat-v7:19.+'
      compile fileTree(dir: 'libs', include: ['*.jar'])
  
      // ORMLite
      compile 'com.j256.ormlite:ormlite-android:4.46'
  
      // Google Guava
      compile 'com.google.guava:guava:16.0.1'
  }
  
  apt {
      arguments {
          androidManifestFile variant.processResources.manifestFile
          resourcePackageName 'pl.grzeslowski.weaselmoney'
      }
  }
  
  android {
      compileSdkVersion 19
      buildToolsVersion "19.0.3"
  
      defaultConfig {
          minSdkVersion 10
          targetSdkVersion 19
          versionCode 1
          versionName "1.0"
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_7
          targetCompatibility JavaVersion.VERSION_1_7
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
  
      sourceSets {
          main {
              manifest.srcFile 'src/main/AndroidManifest.xml'
              java.srcDirs = ['src/main/java', 'GENERATED_FOLDER']
              resources.srcDirs = ['src/main/resources']
              res.srcDirs = ['src/main/res']
              assets.srcDirs = ['src/main/assets']
          }
      }
  }
  </code></pre>
  
  <p>This is log from my console in Android Studio:</p>
  
  <pre><code>Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
  :weasel_moneyWeaselMoney:help
  
  Welcome to Gradle 1.10.
  
  To run a build, run gradle &lt;task&gt; ...
  
  To see a list of available tasks, run gradle tasks
  
  To see a list of command-line options, run gradle --help
  
  BUILD SUCCESSFUL
  
  Total time: 6.111 secs
  
  Process finished with exit code 0
  </code></pre>