When I generate javadoc for my Android project in Eclipse, there are lots of warnings like
cannot find symbol
symbol : class TextView
and
For those of us daring enough to have switched over to the ever-evolving Android Studio & Gradle, one of the things that actually works and makes things a little easier is referring to a package-list location either locally or on the web. For example, the following code from Julian generates javadoc files:
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
title = "Documentation for Android $android.defaultConfig.versionName b$android.defaultConfig.versionCode"
destinationDir = new File("${project.getProjectDir()}/doc/compiled/", variant.baseName)
source = variant.javaCompile.source
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)
description "Generates Javadoc for $variant.name."
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PRIVATE
options.links("http://docs.oracle.com/javase/7/docs/api/");
options.links("http://developer.android.com/reference/reference/");
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
But this resulted in a warning during the build because the package-list isn't available anymore (if it ever was) at
options.links("http://developer.android.com/reference/reference/");
At first I thought maybe the redundant reference/reference was the issue, but the package-list was also unavailable at
options.links("http://developer.android.com/reference/");
So, after reading the discussion on this thread, that one line can be changed to refer to the local reference directory within the SDK:
options.links("c:\\path-to-sdk-directory\\docs\\reference");
It finds the package-list locally and doesn't display the warning message anymore.