Android SDK path

I had a hard time building a Mono for Android project a while back. I thought I should share this.

On building a Mono for Android project using MonoDevelop I got this cryptic error message:

C:\Program Files\MSBuild\Novell\Novell.MonoDroid.Common.targets(2,2): Error: Could not find android.jar for API Level 10.  This means the Android SDK platform for API Level 10 is not installed.  Either install it in the Android SDK Manager, or change your Mono for Android project to target an API version that is installed. (Hello)

Sure, I thought. I’ll just fire up the Android SDK Manager and install the Android SDK for version 2.3 (API Level 10). Easier thought than done, it was already installed. The SDK path reported by the SDK Manager was:


It seems the installer for Mono for Android had messed up the Android SDK path, but where? I looked at the build log and that showed me where MonoDevelop was getting its SDK path:

Target _ResolveMonoAndroidSdks:
 Looking for Android SDK..
 Key HKCU\SOFTWARE\Xamarin\MonoAndroid\PrivateAndroidSdkPath not found.
 Key HKCU\SOFTWARE\Android SDK Tools\Path not found.
 Key HKLM\SOFTWARE\Android SDK Tools\Path found:
 Path contains adb.exe in \platform-tools (C:\Program Files\Android\android-sdk).

All right, so now I knew that the Android SDK was installed in two different folders. The build problem was easily solved after I changed the registry key at HKLM\SOFTWARE\Android SDK Tools\Path to point to the path that the Andoid SDK Manager was reporting.

Now, where was the Android SDK Manager getting its path from? I still don’t know. If any one does happen to know please comment below.

[Thanks to Paul who left a comment below, I discovered that Mono for Android setup added a shortcut to its copy of the Android SDK Manager. One less mystery…]

2 thoughts on “Android SDK path

  1. I just ran in to this same problem.
    My guess is you also have two copies of the Android SDK Manager installed.
    It is just pulling the SDK path from its own local path.
    Uninstall Mono4Android and reinstall making sure it uses your existing Android SDK path.

  2. I also had the same problem. Like Paul suggested, I had two versions installed of the android SDK. Monodroid seems to default to the one in “C:\Program Files (x86)\Android” no matter what you set in the registery or elsewhere. Deleting/renaming this folder solved my issue as the xamian one is installed in “C:\Users\\AppData\Local\Xamarin\MonoForAndroid\AndroidSDK\android-sdk-windows”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s