I have already checked this post: How to download dependency sources for Gradle project in IDEA?
But it didn\'t work for me. Maybe it is because they are referring t
Try this plugin on github. It works for me.
Update: The GitHub repo's README.md now says:
This plugin in deprecated. AndroidStudio 1.4 has this support built in.
Currently Android Studio imports libraries with sources. As for java docs press F1.
Old answer:
As we are talking about early preview, simplest fix wins.
For now is just manually add them to the project in Project Structure dialog. Things are even worse as now Android Studio will strip module files (iml) from all dependencies which are not related to native Android Gradle configurations and tasks e.g. module has robolectric dependency and extra task and config localTest is added in build.gradle. After you open Android Studio it will remove dependency, you need to add it again.
For time being I am keeping iml files and .idea folder in my git. After launch
git checkout myproject/myproject.iml
Unfortunately I cannot comment with my score, so:
Although this isn't an answer, if you use the 'eclipse' plugin in Gradle, you can run
gradle eclipseClasspath
And it will download all the sources and, I believe, Javadoc and create a .classpath with links to their locations.
Then, at least, you will have the sources and javadoc to reference, which I assume you can then reference in IntelliJ.
For Maven sources and docs the only thing I have found is to change the default settings.
File -> Other Settings -> Default Settings... -> Maven -> Importing
Checking the boxes to download Sources and Documentation
As we can see the answer from Xavier Ducrohet (Android SDK Tech Lead Google Inc.), as of July 26, 2013:
I don't think Gradle handles this at this point. I've talked to the devs and they are aware of it. We're looking at adding a hook in Gradle so that we can do it when the tooling API queries the model.