Home » Android » Android studio javadoc task

Android studio javadoc task

Posted by: admin November 1, 2017 Leave a comment


I’ve been struggling to setup a gradle task to generate Javadocs for my Android library, but when there are external dependencies to other libraries, doc generation fails. This seems to be a common task, but somehow there doesn’t seem to be an easy solution, as for example this answer will reveal (re-generating exploded-aar manually is a bit absurd, and also, on Android Studio 3.0 even that doesn’t work anymore due to the new dependency directives).

However, I have noticed that generating Javadoc through the Android Studio GUI (Tools menu) works just fine – dependencies to other libraries are resolved etc. So how does this work – does this menu not utilize a gradle task for generating Javadoc?

Since I need to generate Javadoc using gradle as part of CI I find it very frustrating that there is no documented way of getting it to work, while there is a way that works through the menues. Doesn’t the Android Studio Tools -> Generate Javadoc menu in turn use a gradle task? Since dependencies are listed with gradle files, and the Javadoc tools menu apparently is able to resolve those dependencies – how is it implemented? How does it source the jars embedded in the dependant aar libraries, etc? How can it be used stand-alone and not though the Android Studio GUI?