Moving to the latest Android SDK 26 is highly recommended, but it doesn’t comes with the Source Code for you to debug into the APK. You often get the below when trying to trace into it.
Sources for ‘Android API 26 Platform’ not found.
Clicking Download will end with Package Unavailable
Error.
Workaround
So to workaround, is to revert back to SDK 25 and compile your code… but this is just not acceptable, unless we are okay to stay on the older Android Code Base.
The other workaround, would be better… that is to use SDK 25 Source Code as reference. It could be done by
- Go to your
sdk/sources
folder (if you’re not sure where, you could find it in File →Project Structure →SDK Location in Android Studio. - Replicate the
android-25
intoandroid-26
(i.e.cp -R android-25 android-26
- Go into
android-26
folder. - There’s two files
package.xml
andsource.properties
. Open them, and rename all25
to26
- Reload your Android Studio. Now when you trace Android SDK code, you will get into the source.
Caveat
Note: some source may differs from actual implementation, hence the tracing might be at wrong lines.