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

China☆狼群 提交于 2019-12-04 01:52:27

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.

Barbara RB

You can also set the Android SDK location opening

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

Or you have to re-install Android SDK.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!