title: Android Gradle javadoc annotation does not exists
body: <p>I'm trying to build an aar to publish on jcenter.</p>
  
  <p>The assembleRelease task works ok, the javadoc task also works fine, but the javadocJar task outputs this error:</p>
  
  <blockquote>
    <p>/Users/martinmoreno/Projects/android-dev-utils/dev-utils/src/main/java/com/tinchoapps/devutils/BitmapUtils.java:11: error: package android.support.annotation does not exist<br>
        import android.support.annotation.NonNull;</p>
  </blockquote>
  
  <p>Here is the (simplified) gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.library'
  apply plugin: 'com.github.dcendents.android-maven'
  
  
  android {
      ...
      buildTypes {
          release {
              minifyEnabled false
              shrinkResources false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
              signingConfig signingConfigs.debug
          }
      }
  ...
  }
  
  ...
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:support-annotations:20.0.0'
      compile 'com.android.support:support-v4:22.0.0'
  }
  
  task sourcesJar(type: Jar) {
      from android.sourceSets.main.java.srcDirs
      classifier = 'sources'
  }
  
  task javadoc(type: Javadoc) {
      source = android.sourceSets.main.java.srcDirs
      classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
      destinationDir = file("../javadoc/")
  }
  
  task javadocJar(type: Jar, dependsOn: javadoc) {
      classifier = 'javadoc'
      from javadoc.destinationDir
  }
  
  artifacts {
      archives sourcesJar
      archives javadocJar
  }
  </code></pre>
  
  <p>It seems related to the dependencies because it's giving some "class not found" exceptions too on classes inside the imports, but can't figure out what's wrong.</p>
  
  <p>Any thoughts?</p>