简体   繁体   中英

Android library missing documentation on Android studio Kdoc Dokka

When I import my library from maven there's no available documentation on Android Studio/IntelliSense. Even if I set up Dokka properly and javadoc.jar is present on the maven repo, still can't get it to work. This is the gradle script:

task androidSourcesJar(type: Jar) {
    archiveClassifier.set('sources')
    from android.sourceSets.main.java.srcDirs
}

task androidJavadocsJar(type: Jar, dependsOn: dokkaJavadoc) {
    archiveClassifier.set('javadoc')
    from dokkaJavadoc.outputDirectory
}

afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
                groupId = "xxx"
                artifactId = "xxx"
                version = libVersion

                artifact androidSourcesJar
                artifact androidJavadocsJar

                pom {
                    name = "xxxx"
                    ...
                }
        }
        repositories {
            maven {
               ...
        }
    }

All documentation is in Kdoc, am I missing something?

Thanks in advance!

Solved the issue, all the setup was fine, but I made the mistake of copying the documentation from an original java file with javadoc to a kotlin file with Kdoc and basically, Dokka was failing to parse Kdoc to Javadoc ended up invalid and Android studio couldn't download sources. Build never failed and I had no issues on my CircleCI build hence why was harder for me to find the origin of this problem!

Double-check your documentation to make sure Dokka can convert it properly!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM