Kalyan Basa
Kalyan Basa

Reputation: 317

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.

Upvotes: 13

Views: 30186

Answers (4)

Alin
Alin

Reputation: 313

I had the same problem and the solution to this problem for me was to use vpn.since I live in a country where we are under internet boycott using vpn with some patience helped me a lot. With best wishes...

Upvotes: -1

VadzimV
VadzimV

Reputation: 1261

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.

Upvotes: 3

Barbara RB
Barbara RB

Reputation: 111

You can also set the Android SDK location opening

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

Or you have to re-install Android SDK.

Upvotes: 11

user3137856
user3137856

Reputation: 101

You can solve this by editing the build definition in the VS 2012.

Right click on the Build Definition and Edit Build Definition

Goto Process -> Advanced -> MSBuild Arguments and append the below parameter value to it

/p:AndroidSdkDirectory=C:\android-sdk

it should work.

Upvotes: 9

Related Questions