Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

mac AndroidStudio 不能查看源码 #4

Open
zhanzengyu opened this issue Oct 15, 2019 · 0 comments
Open

mac AndroidStudio 不能查看源码 #4

zhanzengyu opened this issue Oct 15, 2019 · 0 comments
Labels

Comments

@zhanzengyu
Copy link
Owner

zhanzengyu commented Oct 15, 2019

如果 AndroidStudio 不能查看源码,并且 Download 之后还是一样。那么可以按照下面方式处理。

执行命令

cd ~/Library/Preferences/AndroidStudio3.4/options

进入配置目录。

其中我这里 AndroidStudio 版本为 3.4,如果你的版本为其他,上面的目录应该为 AndroidStudio 加上对应版本号。

然后编辑 jdk.table.xml。

里面有各个 SDK 版本的配置。

假设你 AndroidStudio 提示的是 27 有问题,你查找 27。

可以看到

<name value="Android API 27 Platform" />

往下可以看到下面

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

发现缺少源码路径配置,添加修改如下:

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

保存之后重启 AndroidStudio 应该就可以了。

参考:
Mac版Android Studio查看不到源码的解决方法

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant