【AS】Android Studio无法关联Api23源码-提示Souces for android api 23 platform not found
16lz
2021-01-23
Android Studio 中关联源码跟 Eclipse 不太一样:
Eclipse 关联的 SDK 默认没附带源码,需要自己去下载,存放在 $USER_HOME$/charo/software/sdk/sdk/source/src 之下,源码中附带有源码的注释文档,以 Android 中 Activity 的 findViewById 方法为例,如下所示(Activity.class):
/** * Finds a view that was identified by the id attribute from the XML that * was processed in {@link #onCreate}. * * @return The view if found or null otherwise. */ @Nullable public View findViewById(@IdRes int id) { return getWindow().findViewById(id); }
Android Studio 关联的 SDK 本身就自带有源码,但默认源码中不带注释,如下(Activity.class):
/** @deprecated */ @Deprecated public void stopManagingCursor(Cursor c) { throw new RuntimeException("Stub!"); } public View findViewById(int id) { throw new RuntimeException("Stub!"); } public ActionBar getActionBar() { throw new RuntimeException("Stub!"); }
所以 Android Studio 需要我们自己去下载并关联注释文档,首先是下载:
其次是关联,vi $USER_HOME$/.AndroidStudio2.1/config/options/jdk.table.xml(粗体彩色字为添加的内容):
file://$USER_HOME$/charo/software/adt-bundle-linux-x86-20140321/sdk/docs/reference" />
file://$USER_HOME$/charo/software/adt-bundle-linux-x86-20140321/sdk/docs/reference" />
更多相关文章
- Android轻量级存储源码分析
- Android 网络框架 Retrofit 源码解析
- Android 反编译apk 到java源码的方法
- Android属性动画AnimatorSet源码简单分析
- Android内存泄露专题——leakCanary源码分析
- Android ThreadLocal 源码分析
- Android2.2 API 中文文档系列(9) ―― ZoomButton