Setup and Install Xamarin for Visual Studio 2015: Android SDK

Previously there is some errors when installing Android SDK during Visual Studio installation. We are going to fix that problem today. Before we start, let’s have some checking on what is not working.

Open Visual Studio 2015, Click on Tools>Android>Android SDK Manager. Nothing is happening.

1_VS2015_AndroidSDK_01.png

First thing to check is whether the Android SDK path is specify in Options. So, let’s go to Tools>Options>Xamarin>Android Settings. You will notice that there is showing “No Android SDK found”1_VS2015_AndroidSDK_08.png

Now let’s start with the steps to fix the Android SDK.

  1. Open File Explorer and go to C:\Program Files (x86)\Android\android-sdk (default installation path of Visual Studio installer). In my case, the Android SDK is actually installed in the path but it is not setup correctly in Visual Studio. If you cannot find the Android SDK in the path, you can download it from GitHub and get android-sdk-initial folder.1_VS2015_AndroidSDK_11.png
  2. Let’s try to add the path into Options. Open Visual Studio and go to Tools>Options>Xamarin>Android Settings. Then click on Change button.1_VS2015_AndroidSDK_08 - Copy.png
  3. Specify the Android SDK path as C:\Program Files (x86)\Android\android-sdk and click OK button.
    1_VS2015_AndroidSDK_09.png
  4. However, there is some error is pop up saying “Cannot find adb.exe in specified path: …”.  This is because the Android SDK Manager that ship with Visual Studio 2015 is outdated. We will need to update it first before we continue.
    1_VS2015_AndroidSDK_10.png
  5. Go back to File Explorer with the Android SDK Manager. Double click on SDK Manager to RUN it.1_VS2015_AndroidSDK_11.png
  6. You should be seeing Android SDK Manager dialog. It might take some time if your machine is slow.
    1_VS2015_AndroidSDK_12.png
  7. Uncheck everything. Then check only the following:
    – Android SDK Tools
    – Android SDK Platform-tools
    – Android SDK Build-tools (I don’t think this is necessary, but I just install it :D)
  8. Click Install 2 packages and accept the terms to proceed the installation.
    1_VS2015_AndroidSDK_14.png
  9. However, if you are using Windows 10 like I am, you should be having error to install the packages. The error is reporting “Failed to create directory C:\Program Files (x86)\Android\android-sdk\temp”.  This is because you will need to have Administrator rights to work in Program files folder.
    1_VS2015_AndroidSDK_15.png
  10. What I normally do is put the Android SDK to other location. In this guide, I put the Android SDK folder in C:\Users\[username]\AppData\Local\Android\android-sdk
  11. After moved the folder, RUN the SDK Manager and install the packages. You should be able to install the packages normally and seeing the following status. If you having problem to update the SDK Manager, you can download it from GitHub and get android-sdk-updated folder.
    1_VS2015_AndroidSDK_17.png
  12. After complete update the packages, you will need to RESTART the Android SDK Manager. Just close the SDK dialog and reopen it by double clicking the SDK Manager. You will notice that the folder structure of the SDK folder is already updated too.
    1_VS2015_AndroidSDK_19.png
  13. After reopen the SDK Manager, you will see more packages is listed.
  14. Proceed to update and install the remaining packages that we need. Recommended packages to install can be refer to HERE
    1_VS2015_AndroidSDK_18.png
  15. After all packages is installed, we may proceed to set the path in Visual Studio. Open Visual Studio, go to Tools>Options>Xamarin>Android Settings. Then click on Change button.
  16. Specify the Android SDK path as C:\Users\[username]\AppData\Local\Android\android-sdk and click OK button.
    1_VS2015_AndroidSDK_20.png
  17. You should be able to set the Path successfully and seeing a green check mark for Android SDK Location.
    1_VS2015_AndroidSDK_21.png
  18. Finally, after so many steps, you are now setup Visual Studio with Android SDK successfully.

 

You can find the other parts of the guide here:

Leave a comment