Android Studio Javadoc: Cannot find symbol

杀马特。学长 韩版系。学妹 提交于 2019-11-28 05:07:52

You should also add all your dependency to the javadoc.classpath. Try this:

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

afterEvaluate {
    javadoc.classpath += files(android.libraryVariants.collect { variant ->
        variant.javaCompile.classpath.files
    })
}

So these error mean that JavaDoc can't link the classes which are not in the same module (without further config). If you don't care about this (ie. having hyperlinks to classes outside of the module) you could just ignore the errors with

task javadoc(type: Javadoc) {
    failOnError false
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

See here for more info on the Javadoc Task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!