安装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

  • For more information about using the SDK Manager and some of the available packages, see the SDK Manager document.
  • This web site provides all information you need to develop Android apps, including design guidelines,developer training, API reference, and information about how you can distribute your app. We recommend you begin by reading Building Your First App.
  • For additional resources about developing and distributing your app, see theDeveloper Support Resources.

 

 

 

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

 

问题一:无法安装 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版本了。

 

 

 

你可能感兴趣的:(安装Android Platforms(官网方法) 及遇见问题解决)