最近升级了As,然后忽然就关联不上源码了,很不方便,找个Activity的源码都只有outline没有解释,还提示这个错误:

Decompiled .class file, bytecode version: Souces for android api 23 platform not found

在D:\Android\sdk\sources\android-23明明下载了源码,找了半天,原来是AS的默认配置有问题。最后的解决方法在 StackOverFlow的这个帖子上:

Sources for Android API 23 Platfrom not found (Android Studio 2.0)

0down voteaccepted

For people facing the same problem, the solution is in this post for Linux and in the same topic here for Windows (thanks to Aamir Abro). Basically you have to edit jdk.table.xml file for API level you are missing. I don't know why, but Android 2.0 and 2.1 RC don't have filled <root type="composite" />in <sourcePath>. I updated sources' path <root type="simple" url="file://D:/android/sdk/sources/android-23" /> and now it works.

Windows file locationC:\Users{USER_NAME}.AndroidStudio2.0\config\options\jdk.table.xml

Linix file location~/Library/Preferences/AndroidStudioBeta/options/jdk.table.xml

具体操作是:找到jdk.table.xml这个文件,在<sourcePath>节点下添加这一句<root type="simple" url="file://D:/android/sdk/sources/android-23" />

修改后的部分配置文件如下:

<jdk version="2">
<name value="Android API 23 Platform" />
<type value="Android SDK" />
<homePath value="D:\Android\sdk" />
<roots>
<annotationsPath>
<root type="composite">
<root type="simple" url="jar://$APPLICATION_HOME_DIR$/plugins/android/lib/androidAnnotations.jar!/" />
</root>
</annotationsPath>
<classPath>
<root type="composite">
<root type="simple" url="jar://D:/Android/sdk/platforms/android-23/android.jar!/" />
<root type="simple" url="file://D:/Android/sdk/platforms/android-23/data/res" />
</root>
</classPath>
<javadocPath>
<root type="composite">
<root type="simple" url="file://D:/Android/sdk/docs/reference" />
</root>
</javadocPath>
<sourcePath>
<root type="composite">
<root type="simple" url="file://D:/Android/sdk/sources/android-23" />
</root>
</sourcePath>
</roots>
<additional jdk="1.7" sdk="android-23" />
</jdk>

Android Studio无法关联Api23源码-提示Souces for android api 23 platform not found的更多相关文章

  1. 如何用Android Studio查看build.gradle源码

    上一篇博客里讲过 build.gradle 里的每一行代码基本都是在调用一个方法,既然是这样,我们就可以用 android studio(下面简称as) 去查看它源码的方法注释说明,这样就可以理解每个 ...

  2. Android studio导入第三方类库源码以及jar包

    新建一个Android项目,项目结构如下: 1.添加第三方类库源码 首先将第三方类库考入与app同级的目录下: 之后,在build.gradle(Moudule:app)下添加编译代码:在seting ...

  3. 图解Android Studio导入Eclipse项目源码

    方法/步骤   打开Android Studio,在主页面中选择"File"->"New"->"Import project...&quo ...

  4. Android Studio导入github项目源码步骤

    1.从github上将源码下载下来 2.打开AS,新建一个新项目(我选择了EmptyActivity) 3.先不要在AS 中打开源码,来整理源码 在源码的目录下面,将project下的build.gr ...

  5. 关于Android Studio 3.2 运行应用时提示 “Instant Run requires that the platform corresponding to your target device (Android 7.0 (Nougat)) is installed.” 的说明

    点击"Run",运行App后,Android Studio显示如图1-1界面: 图1-1 这是因为你连接的外部设备(比如Android手机或AVD)的SDK版本在你的电脑上没有安装 ...

  6. Decompiled .class file,bytecode version:51.0(Java 7) Source for 'Android API 23 Platform' not found

    今天在Android Studio中访问Java源码的时候,代码上方出现如下提示: 而且方法体中显示介样内容: throw new RuntimeException("Stub!" ...

  7. Android基础之在Eclipes中关联SDK源码和查看SDK源码

    在进行Android应用开发的时候,我们有时候需要查看某个类或接口的源码从而了解如何去使用一个类或者实现一个接口,查看源码有助于我们的学习某个封装的类的底层是如何实现的,这样可以帮助我们掌握类或者接口 ...

  8. Android Studio导入Android 4.4.4r1的源码

    本文博客地址:http://blog.csdn.net/qq1084283172/article/details/70339471 一.环境配置 1.ubuntu 14.04.5 x64bit 2.j ...

  9. Android 7.1.1系统源码下载、编译、刷机-Nexus 6实战

    想成为一位合格的Android程序员或者一位Android高级工程师是十分有必要知道Android的框架层的工作原理,要知道其工作原理那么就需要阅读Android的源代码. 想要阅读Android的源 ...

随机推荐

  1. NET基础课--JIT编译器如何工作1

    1..Net运行时调用JIT编译器,用来把由C#编译器生成的IL指令编译成机器代码.这一任务在应用程序的运行期间是分步进行的.JIT并不是在程序一开始就编译整个应用程序,取而代之的是,CLR是一个函数 ...

  2. Oracle11g客户端安装及plsql配置

    1,项目使用的是oracle11g数据库,安装个客户端访问服务器. 到oracle官方下载: http://www.oracle.com/technology/global/cn/software/t ...

  3. 新浪微博iOS示例,登录,获取个人信息

    1.导入第三方库和系统框架

  4. Python之路第十天,高级(2)-多线程,多进程,协程

    线程 threading threading模块对象 描述 Thread 表示一个线程的执行对象 Lock 锁原语对象 RLock 可重入锁对象,使单线程可再次获得已经获得了的锁(递归锁定) Cond ...

  5. SQL Server 对表的 12 种一般性操作

    01. 创建 create table Strings(ID int);    go 02. 为表添加列 alter table Strings    add String nvarchar(32); ...

  6. JAVA笔记1-00

    package chapter1; public class Demo1 { public static void main(String[] args) { System.out.println(& ...

  7. BCB的博客,以及例子(好多传输文件的例子)

    http://blog.csdn.net/keyu1711/ http://download.csdn.net/user/keyu1711 http://download.csdn.net/user/ ...

  8. 在WPF中自定义你的绘制(五)

    原文:在WPF中自定义你的绘制(五) 在WPF中自定义你的绘制(五)                                                                   ...

  9. haproxy ssl相关配置

    ssl-default-bind-options [<option>]... This setting is only available when support for OpenSSL ...

  10. (转载博文)MFC 窗口句柄获取

    句柄获取方法(获取该窗口的句柄后,即可向该窗口类类发送消息.处理程序):0.获取所在类窗口的句柄: this->m_hwnd 1.主窗口的句柄: 无论在主窗口类内,还是子窗口类内,获取主窗口句柄 ...