Android Studio相关使用方法

本文介绍了如何在Android Studio中手动关联源码。首先,需要找到Android Studio的配置文件夹,通常位于用户目录下,如C:UsersHenry.AndroidStudio2.2configoptions。接着,编辑jdk.table.xml文件,调整源码路径设置,以确保AS能正确加载自定义源码位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、关联源码

AS默认从当前工程最新SDK源码往下查找,有时源码不在默认位置,就需要手动关联到当前已有源码包去,下面是关联步骤:

a)到AS的数据目录.AndroidStuido2.2下找到jdk.table.xml文件,我的位置是C:\Users\Henry\.AndroidStudio2.2\config\options\jdk.table.xml

b)打开jdk.table.xml,xml节点结构如下:

<application>
  <component name="ProjectJdkTable">
    <jdk version="2">
      <name value="Android API 8 Platform" />
      <type value="Android SDK" />
      <homePath value="C:\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://C:/Android/sdk/platforms/android-8/android.jar!/" />
            <root type="simple" url="file://C:/Android/sdk/platforms/android-8/data/res" />
            <root type="simple" url="jar://C:/Android/sdk/tools/support/annotations.jar!/" />
          </root>
        </classPath>
        <javadocPath>
          <root type="composite">
            <root type="simple" url="file://C:/Android/sdk/docs/reference" />
          </root>
        </javadocPath>
        <sourcePath>
          <root type="composite" >
			<root type="simple" url="file://C:\Android\sdk\sources\android-24"/>
		  </root>
        </sourcePath>
      </roots>
      <additional jdk="1.8" sdk="android-8" />
    </jdk>
  </component>
</application>
在25-29行区域<sourcePath>标签即是源码的配置标签,在url属性中配置源码路径,不要求sdk版本与源码版本一致(3行),可错位配置源码,重启AS即可。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值