Zarokka
Zarokka

Reputation: 3056

Add local javadoc to local aar in Android-Studio

Is there a way to attach javadocs, provided in a jar, to a aar library? There is no source code available and both files exist locally (not in a repository).

The aar is added through:

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile(name:'library', ext:'aar')
}

And works fine (besides the inability to add docs).

What I tried (and did not work):

Environment:
Android-Studio 0.8.2
gradle plugin 0.12

It might not be possible ATM (see this bug: https://code.google.com/p/android/issues/detail?id=73087) but any workaround would be appreciated.

Upvotes: 31

Views: 3534

Answers (2)

Zarokka
Zarokka

Reputation: 3056

It is possible now to attach locale javadocs to an aar in Android-Studio, there are still problems though.

This works with Android-Studio 1.3.2 and Android-Gradle-Plugin 1.3 and Gradle 2.5.

In the Project view -> select "Project" viewing style -> Expand "External Libraries" and right click on the desired library -> select "Library Properties..."

Image that shows how to find the "Library Properties"

(The image just shows where to find the "Library Properties", i know that this is not necessary for appcompat)

In the upcoming dialog click the + Symbol and point to the location where the unpacked javadocs are stored.

Caveat:
The settings does currently not survive a gradle project sync.

Reference:
https://code.google.com/p/android/issues/detail?id=73087

Upvotes: 1

Rene Xu
Rene Xu

Reputation: 1103

there is a workaround, you can install your aar and source codes to local maven repo and import it from there.

Upvotes: 0

Related Questions