比如是26找不到
解决办法:
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-26" />
</root>
</sourcePath>
注:url的地址,需要根据自己的路径来确定。
3.重启as
修改后代码如下:
<jdk version="2">
<name value="Android API 26 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-26/android.jar!/" />
<root type="simple" url="file://$USER_HOME$/Library/Android/sdk/platforms/android-26/data/res" />
</root>
</classPath>
<javadocPath>
<root type="composite">
<root type="simple" url="http://developer.android.com/reference/" />
</root>
</javadocPath>
<sourcePath>
<root type="composite">
<root type="simple" url="file://$USER_HOME$/Library/Android/sdk/sources/android-26" />
</root>
</sourcePath>
</roots>
<additional jdk="1.8" sdk="android-26" />
</jdk>