paint-brush
Workaround to view unavailable Android SDK 26 source codeby@elye.project
1,752 reads
1,752 reads

Workaround to view unavailable Android SDK 26 source code

by ElyeAugust 16th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Workaround to view unavailable Android SDK 26 source code
Elye HackerNoon profile picture

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

  1. 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.
  2. Replicate the android-25 into android-26 (i.e. cp -R android-25 android-26
  3. Go into android-26 folder.
  4. There’s two files package.xml and source.properties. Open them, and rename all 25 to 26
  5. 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.

Credits goes to Jake Wharton for the solution as posted below.

<a href="https://medium.com/media/fc32b2a3d323d0ebeba7fe63a5bdcd38/href">https://medium.com/media/fc32b2a3d323d0ebeba7fe63a5bdcd38/href</a>

Click “❤” below to share. Thanks! ~Twitter:elye; Facebook:elye