It might be very trivial question, But I couldn\'t find any option to attach javadoc/source with local jar dependencies (in libs folder) in android project. I can\'t believe
in android studio if you use compileSdkVersion 23
in buidl.gradle and you have downloaded the SDK 23 document file and source file in SDK manager
, the android API and java API doc and source will all show auto, you don't need to manual set.
I've found & tested a way in which we can add the javadocs without loosing them after a gradle sync.
file:///opt/android-sdk/extras/google/google_play_services/docs/reference
This placed the same JAVADOC entry in the xml identified by Jason but doesn't disappear after doing a sync with gradle
It is possible:
Project structure
Another way to attach sources:
Personally tested successfully!
1.Project Structure(ctrl+alt+shift+s)
2.SDK Location
3.JDK Location
4.UnCheck "Use embedded JDK(recommended)"
5.Select your own jdk path(My Path:C:\Program Files\Java\jdk1.8.0_111)
6.Synchronized(ctrl+alt+y)
success
After some investigation, I stumbled upon this:
https://github.com/xujiaao/AARLinkSources
Works like magic!
I found a solution just now since I can't find any other solution for a long time.
suppose:
under folder .idea/libraries, you can find libxxx.xml. replace JAVADOC with
<JAVADOC>
<root url="jar://C:/yourpath/doc.zip!/" />
</JAVADOC>
then ctrl+alt+y to sync the project. (Don't do "Sync Project with Gradle files", it will delete the changes)