Android Studio Javadoc: Cannot find symbol

后端 未结 2 578
半阙折子戏
半阙折子戏 2020-12-08 05:51

I\'m trying to prepare and upload my Android library to Bintray and part of that process runs the following javadoc task:

task javadoc(type: Javadoc) {
    s         


        
相关标签:
2条回答
  • 2020-12-08 06:31

    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

    0 讨论(0)
  • 2020-12-08 06:55

    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.javaCompileProvider.get().classpath.files
        })
    }
    
    0 讨论(0)
提交回复
热议问题