Sources for 'Android API 24 Platform' not found.[MAC]

来源:互联网 发布:企业网络危机公关处理 编辑:程序博客网 时间:2024/05/29 15:08


解决办法:

1.找到以下路径,并打开文件

~/Library/Preferences/AndroidStudioXXX/options/jdk.table.xml

2.修改

<sourcePath>          <root type="composite" /></sourcePath>

修改后:

        <sourcePath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/sources/android-24" />          </root>        </sourcePath>

注:url的地址,需要根据自己的路径来确定。


3.重启as


修改后部分代码:

    <jdk version="2">      <name value="Android API 19 Platform" />      <type value="Android SDK" />      <homePath value="$USER_HOME$/Library/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://$USER_HOME$/Library/Android/sdk/platforms/android-19/android.jar!/" />            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/platforms/android-19/data/res" />          </root>        </classPath>        <javadocPath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/docs/reference" />          </root>        </javadocPath>        <sourcePath>          <root type="composite" />        </sourcePath>      </roots>      <additional jdk="1.8" sdk="android-19" />    </jdk>    <jdk version="2">      <name value="Android API 24 Platform" />      <type value="Android SDK" />      <version value="java version "1.8.0_91"" />      <homePath value="$USER_HOME$/Library/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://$USER_HOME$/Library/Android/sdk/platforms/android-24/android.jar!/" />            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/platforms/android-24/data/res" />          </root>        </classPath>        <javadocPath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/docs/reference" />          </root>        </javadocPath>        <sourcePath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/sources/android-24" />          </root>        </sourcePath>      </roots>      <additional jdk="1.8" sdk="android-24" />    </jdk>    <jdk version="2">      <name value="Android API 23 Platform" />      <type value="Android SDK" />      <homePath value="$USER_HOME$/Library/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://$USER_HOME$/Library/Android/sdk/platforms/android-23/android.jar!/" />            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/platforms/android-23/data/res" />          </root>        </classPath>        <javadocPath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/docs/reference" />          </root>        </javadocPath>        <sourcePath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/sources/android-23" />          </root>        </sourcePath>      </roots>      <additional jdk="1.8" sdk="android-23" />    </jdk>

注:需要找到:API 24 里面修改

    <jdk version="2">      <name value="Android API 24 Platform" />      <type value="Android SDK" />      <version value="java version "1.8.0_91"" />      <homePath value="$USER_HOME$/Library/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://$USER_HOME$/Library/Android/sdk/platforms/android-24/android.jar!/" />            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/platforms/android-24/data/res" />          </root>        </classPath>        <javadocPath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/docs/reference" />          </root>        </javadocPath>        <sourcePath>          <root type="composite">            <root type="simple" url="file://$USER_HOME$/Library/Android/sdk/sources/android-24" />          </root>        </sourcePath>      </roots>      <additional jdk="1.8" sdk="android-24" />    </jdk>




0 0
原创粉丝点击