安装Android Platforms(官网方法) 及遇见问题解决

Adding Platforms and Packages

官网链接:http://developer.android.com/sdk/installing/adding-packages.html

 

The Android SDK separates tools, platforms, and other components into packages you can  download using the Android SDK Manager. The original SDK package you've downloaded includes only the SDK Tools. To develop an Android app, you also need to download at least one Android platform and the latest SDK Platform-tools.

  1. Launch the SDK Manager.

    If you've used the Windows installer to install the SDK tools, you should already have the Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of the following ways:

    • On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory.
    • On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk.
  2. The SDK Manager shows all the SDK packages available for you to add to your Android SDK. As a minimum configuration for your SDK, we recommend you install the following:
    • The latest Tools packages (check the Tools folder).
    • The latest version of Android (check the first Android folder).
    • The Android Support Library (open the Extras folder and check  Android Support Library).

    Once you've chosen your packages, click Install. The Android SDK Manager installs the selected packages into your Android SDK environment.

With these packages installed, you're ready to start developing. To get started, read Building Your First App.

Figure 1. The Android SDK Manager shows the SDK packages that are available, already installed, or for which an update is available.

Additional information

 

 

 

上面的方法是基本的方法,但是在安装过程中会遇到下面的问题:

 

问题一:无法安装 Platforms And Packages

Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-7.xml, reason: SSLPeerUnverified peer not authenticated

Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml,reason: peer not authenticated

解决方案:

第一步:打开 Android  SDK Manager------>Tools------------>Manage Add-on Sites ----------->User Defined Sites--------------> 分别新建http://dl-ssl.google.com/android/repository/repository-7.xml(htpp没有s)和http://dl-ssl.google.com/android/repository/addons_list-2.xml,reason(http没有s)

第二步:打开Android  SDK Manager------>Tools------------->Options------------->Others 框中勾选Force https://...sources to be fetched using http://....(有s和没s的区别)

这样设置后,你就可以重新下载Platforms and Packages 了。

 

 

 

问题二:ADT和sdk不兼容问题,如果遇到这样的问题,只能去下载符合要求的ADT和sdk版本了。

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值