简体   繁体   English

在 Mac OSX 10.12 上安装 Android Studio 无法安装 android sdk

[英]Installing Android Studio on Mac OSX 10.12 fails to install android sdk

I want to do some android development.我想做一些android开发。

I have a new macbook, on Mac OSX version 10.12.6我有一台新的 macbook,在 Mac OSX 版本10.12.6

I go to https://developer.android.com/studio/index.html and download version 3.0.0.18 for the mac of Android Studio.我去https://developer.android.com/studio/index.html并下载 Android Studio 的 mac 版本3.0.0.18

The download completes, I drag the app into my Applications Folder, and run.下载完成,我将应用程序拖到我的应用程序文件夹中,然后运行。

Android Studio then shows this error: Android Studio 然后显示此错误: 在此处输入图片说明

This says the Android SDK is not found -- which is true I don't have one installed.这表示未找到 Android SDK——这是真的,我没有安装。

I click next and am shown this screen - which is where I find the problem:我单击下一步并显示此屏幕 - 这是我发现问题的地方: 在此处输入图片说明

The box on this screen says Android SDK - (installed) which is strange because the Android SDK is not installed.此屏幕上的框显示Android SDK - (installed) ,这很奇怪,因为安装 Android SDK。 The screen suggests the android SDK location is /Users/me/Library/Android/sdk however this directory does not exist on my machine.屏幕显示 android SDK 位置是 /Users/me/Library/Android/sdk 但是这个目录在我的机器上不存在。

I click Next, then Finish and am presented with this screen:我单击下一步,然后单击完成并显示以下屏幕:

在此处输入图片说明

Can somebody please help me -- Android Studio should download for me the SDK if I don't have one installed so why does it believe I have one when I don't?有人可以帮我 - 如果我没有安装 SDK,Android Studio 应该为我下载 SDK,为什么它认为我没有安装 SDK?

I believe the problem here was a firewall blocking the outbound call to the download server, which was not reported correctly from the Android Studio. 我认为这里的问题是防火墙阻止了对下载服务器的出站呼叫,而Android Studio并未正确报告该事件。

Trying the install from a different location worked first time. 尝试从其他位置进行安装是第一次。

Its because you should run application behind proxy, pretty weird huh?因为你应该在代理后面运行应用程序,很奇怪吧? I had this problem when i clone repo with git desktop and same issue as you had.当我使用 git desktop 克隆 repo 时遇到了这个问题,并且遇到了与您相同的问题。
First of all find a proxy.首先找一个代理。

https://hidemy.name/tr/proxy-list/?type=h#list

For git desktop you have to change your git config proxy:对于 git 桌面,您必须更改 git 配置代理:

git config --global http.proxy http://proxy.mycompany:80

So now you can clone with github desktop app.所以现在您可以使用 github 桌面应用程序进行克隆。
And for Android Studio when you get Android Studio First Run dialog box click Setup Proxy and enter proxy and it will be fine.而对于 Android Studio,当您获得 Android Studio First Run 对话框时,单击 Setup Proxy 并输入 proxy 就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM