Reputation: 183
I am unable find the source when after I downloaded the SDK. Has it been removed from public access?
Upvotes: 18
Views: 15397
Reputation: 12112
I found my sources in the following directory:
<SDK_DIR>/sources/android-26
<SDK_DIR>/sources/android-28
Setting those directories in Android Studio allowed it to attach to the sources.
Sources for some components are only available in some of the version specific sub-directories.
I'm on Windows 10, using Android Studio 3.4.
Upvotes: 0
Reputation: 163
Using Android Studio to read support library source is a more convenient way.Please follow these steps:
compile 'com.android.support:appcompat-v7:23.1.0'
in Android Studio project's build.gradle.$PROJ/build/intermediates/exploded-aar/com.android.support/design/23.1.0/jars
Upvotes: 0
Reputation: 13938
Those that are looking for sources per version, can find it locally (provided that you downloaded it previously) at:
$SDK_DIR/extras/android/m2repository/com/android/support/$libname/$version/$libname-$version-sources.jar
Jar file (as you probably know) is essentially a zip file - therefore you can simply extract its contents.
For example, support-v4 v23.1.1
located at:
$SDK_DIR/extras/android/m2repository/com/android/support/support-v4/23.1.1/support-v4-23.1.1-sources.jar
Upvotes: 3
Reputation: 2503
Some of the src
folders on my copy of the samples, found at $SDK_DIR/extras/android/support/
seem to be empty. For example, v7/gridlayout/src/
is an empty folder, but most of my v4
folders have the source code supplied alongside the download from the SDK Manager, so I'm going to guess you and I are seeing the same issue.
However, you can always download the source directly from the source (no pun intended):
Doing a git clone https://android.googlesource.com/platform/frameworks/support/
to download the support library files direct from Google's repository seems to contain all of the source files.
Upvotes: 38
Reputation: 111
go to Android SDK manager then> go to extras>select Android Support Libraries >check on that and install it
Upvotes: -3