Bug 948 - MonoDevelop fails to start the Android emulator on Windows XP when path to the SDK has spaces
Summary: MonoDevelop fails to start the Android emulator on Windows XP when path to th...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: 2.6
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Mikayla Hutchinson [MSFT]
Depends on:
Blocks: 845
  Show dependency tree
Reported: 2011-09-20 20:33 UTC by Marek Habersack
Modified: 2014-05-22 19:01 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marek Habersack 2011-09-20 20:33:40 UTC
After installing M4A, the Android SDK and MonoDevelop on Windows XP 64-bit (I suppose it happens on 32-bit too, haven't tested that though) MonoDevelop is unable to start the Android emulator if path to the SDK set in the MonoDroid options contains spaces. It's a bug in Android SDK but MonoDevelop could work around it by getting the short form of the path before launching the emulator.

This p/invoke can retrieve the short form (note that the path must exist on disk):

[DllImport ("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern uint GetShortPathName (
        [MarshalAs (UnmanagedType.LPTStr)] string longPath,
        [MarshalAs (UnmanagedType.LPTStr)] StringBuilder shortPath,
	uint shortPathLength);

It is necessary to do that only on Windows XP/XP 64-bit, newer versions of Windows work fine.
Comment 2 Mikayla Hutchinson [MSFT] 2014-02-21 14:42:38 UTC
Is this still an issue with the latest versions?
Comment 3 Mikayla Hutchinson [MSFT] 2014-05-22 19:01:40 UTC
XP is officially EOL and XS will be dropping support for it soon.