Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio : The Android SDK Directory could not be found. Please set via /p:AndroidSdkDirectory

I have installed Xamarin plugin for Visual Studio 2012.

And when create an Android Project and build the same. I am getting the following error.

Error 1 The Android SDK Directory could not be found. Please set via /p:AndroidSdkDirectory. AndroidApplication1

I think this error is due to some mapping.

Kindly guide to resolve this issue.

Thanks in advance.

like image 629
Kalyan Basa Avatar asked Apr 15 '14 08:04

Kalyan Basa


People also ask

How do I find Android SDK path?

Navigate to the File > Settings option you will get to see below dialog screen. Inside that screen. Click on Appearance and Behavior option > System Settings options and then click on the Android SDK option to get to see the below screen. Inside this screen, you will get to see your SDK path.


2 Answers

You can also set the Android SDK location opening

Tools -> Options -> Xamarin -> Android Settings.

Or you have to re-install Android SDK.

like image 72
Barbara RB Avatar answered Sep 22 '22 04:09

Barbara RB


If you don't have Visual Studio try to set Android SDK path to AndroidSdkDirectory environment variable.

For example I have Android SDK installed in /home/user1/.android-sdk-installer/android-sdk-linux, so I set environment variable like this in terminal:

export AndroidSdkDirectory=/home/user1/.android-sdk-installer/android-sdk-linux

Do not forget that export set environment variables only for current terminal.

Also it's easier to set environment variable once, rather then pass /p:AndroidSdkDirectory every time you want to build.

like image 38
VadzimV Avatar answered Sep 25 '22 04:09

VadzimV