Workaround to view unavailable Android SDK 26 source code

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值