I have android library project which depends on other android library projects. I need to generate javadoc for library but it fails because gradle puts to javadoc classpath
This only works for Android Studio older than 2.3 and/or Gradle older than 3.3
To add the JARs from the AARs you can add the following doFirst
to the javadoc task:
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
}
.doFirst {
classpath += fileTree(dir: "$buildDir/intermediates/exploded-aar/", include:"**/classes.jar")
}
It will add all .jar
files from all the AARs to the javadoc classpath. (option 1 from your proposed solutions)