最近升级了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. java-随学随记之基础篇

    一.Java是一门高级语言,具有跨平台性(一次编译到处运行) 1.javac.exe命令,编译器   javac 源文件名.java 2.java.exe命令,启动虚拟机 java 类名 二.环境变量 ...

  2. Android studio教程:[2]项目整体布局

    上篇介绍了如何创建项目,这一次将介绍创建完的项目如何呈现在开发者的眼前,介绍android studio开发环境的整体布局,让大家知道各个模块的位置和功能. 工具/原料 Android studio ...

  3. JQ 操作样式,单选按钮跟复选框

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. cocoapods导入第三方库

    1.移除现有Ruby默认源 终端:gem sources --remove https://rubygems.org/ 2.使用新的源 终端:gem sources -a https://ruby.t ...

  5. HDU 5727 - Necklace

    题意:( 0 <= n <= 9 )    现在有n颗阴珠子和n颗阳珠子,将它们阴阳相间圆排列构成一个环,    已知有些阴珠子和阳珠子不能放在相邻的位置,否则这颗阳珠子就会失去功效,   ...

  6. javabean对象自动赋值给另一个javabean对象

    方法1:把JavaBean的from的值自动set给to,省略了自己从from中get然后再set给to import java.beans.BeanInfo;import java.beans.In ...

  7. Android 瘦身攻略

    http://www.jayfeng.com/2015/12/29/APK%E7%98%A6%E8%BA%AB%E5%AE%9E%E8%B7%B5/

  8. 学php之翻译wordpress(2)

    wp-load.php <?php /** * Bootstrap file for setting the ABSPATH constant * and loading the wp-conf ...

  9. YII学习,实现基于数据库的后台登录,用户体系.

    上次研究Yii框架写到了要完成用户登陆系统.这次接着上次的写. 参考官方权威指南和参考手册,外加各种博客文章.历尽千辛万苦,数遍天上滴星星.完成了后台用户登录.这里用到了YII框架的 CUserIde ...

  10. netty实现消息转发服务

    1.结构图 2.消息服务器 消息服务器(SNS)由Http Netty Server(HNS)和WebSocket Netty Server(WNS)组成.HNS采用Netty Http+XML协议栈 ...