美文网首页
android studio关联源码失败

android studio关联源码失败

作者: 喝那个东南西北风 | 来源:发表于2017-02-09 14:29 被阅读0次

1.出现源码找不到,提示下载,但是下载了源码刷新还是没用,参考文章:

修复源码关联失败

主要就是找到android studio的配置文件:

C:\Users\(你的用户名)\.AndroidStudio2.2\config\options\jdk.table.xml

打开上面的xml文件里面有多个jdk 节点,我是platform 22的关联不上,找到 属于platform 22的jdk节点:

    <jdk version="2">
      <name value="Android API 22 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-22/android.jar!/" />
            <root type="simple" url="file://D:/Android-SDK/platforms/android-22/data/res" />
          </root>
        </classPath>
        <javadocPath>
          <root type="composite">
            <root type="simple" url="file://D:/Android-SDK/docs/reference" />
          </root>
        </javadocPath>
        <sourcePath>
          <root type="composite"/>
        </sourcePath>
      </roots>
      <additional jdk="1.8" sdk="android-22" />
    </jdk>

里面有个sourcepath节点,root节点没用任何内容,修改为你的源码所在路径如下:

        <sourcePath>
          <root type="composite">
            <root type="simple" url="file://D:/Android-SDK/sources/android-19" />
          </root>
        </sourcePath>

保存修改,重启android studio即可关联完成

相关文章

网友评论

      本文标题:android studio关联源码失败

      本文链接:https://www.haomeiwen.com/subject/cbiiittx.html