Bug 19419 - Cannot Merge Mono Runtime into app bundle if build path contains spaces
Summary: Cannot Merge Mono Runtime into app bundle if build path contains spaces
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: mmp ()
Version: 1.8.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 1.8.1
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2014-04-30 11:25 UTC by Radu
Modified: 2014-07-25 12:06 UTC (History)
7 users (show)

Tags:
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:
Status:
VERIFIED FIXED

Description Radu 2014-04-30 11:25:32 UTC
The title says it all

It is not actually clear from the build output what is the reason for the error, but I managed to find out.
Comment 2 Jon Goldberger [MSFT] 2014-05-06 15:23:40 UTC
I replicated this error by creating a new Xam.Mac project in a folder with white space in its name, choosing Release configuration and running the app. I then moved the solution to a folder with no white space and the error did not occur. 

Here is the error message and build output from a failed deploy when there is whitespace in the build path:

Error 1: Merging Mono Runtime failed. See Build Output for details. (1)

Merging Mono Runtime into app bundle
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin/mmp "-minos=10.6" --sdkroot "/Applications/Xcode.app/Contents/Developer" -o "/Users/apple/Documents/Xamarin/Support Project with white space/TestWhiteSpace/TestWhiteSpace/bin/Release" -n "TestWhiteSpace" --profile "4.0" -a "/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/System.dll" -a "/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/System.Xml.dll" -a "/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/System.Core.dll" -a "/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/System.Xml.Linq.dll" -a "/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/System.Drawing.dll" -a "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/XamMac.dll" -a "/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/System.Core.dll" "/Users/apple/Documents/Xamarin/Support Project with white space/TestWhiteSpace/TestWhiteSpace/bin/Release/TestWhiteSpace.exe"
Process exited with code 1, command:
xcrun -sdk macosx clang -v -mmacosx-version-min=10.6 -arch i386 /Library/Frameworks/Xamarin.Mac.framework/Versions/1.8.0.8/lib/libxammac.a -o "/Users/apple/Documents/Xamarin/Support Project with white space/TestWhiteSpace/TestWhiteSpace/bin/Release/TestWhiteSpace.app/Contents/MacOS/TestWhiteSpace" -D_THREAD_SAFE -I/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig/../../include/mono-2.0   /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig/../../lib/libmono-2.0.a /Users/apple/Documents/Xamarin/Support Project with white space/TestWhiteSpace/TestWhiteSpace/bin/Release/TestWhiteSpace.app/Contents/MacOS/main.m -framework AppKit -liconv
error MM5306: Missing dependencies. Please install Xcode 'Command-Line Tools' component
mmp exited with code 1

---------------------- Done ----------------------

Build: 1 error, 0 warnings


My version info: 

=== Xamarin Studio ===

Version 5.0 (build 784)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
Runtime:
	Mono 3.4.0 ((no/c3fc3ba)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000204

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.Android ===

Version: 4.12.4 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.iOS ===

Version: 7.2.3.20 (Business Edition)
Hash: 865c609
Branch: 
Build date: 2014-04-29 00:45:34-0400

=== Xamarin.Mac ===

Xamarin.Mac: 1.8.0.8

=== Build Information ===

Release ID: 500000784
Git revision: ea367c9e829e7c627ec8927e8832df6a74390d61
Build date: 2014-04-29 09:48:53-04
Xamarin addins: 92dcfc8532a8c6d21783289c176417d7c17bf492

=== Operating System ===

Mac OS X 10.9.2
Darwin  13.1.0 Darwin Kernel Version 13.1.0
    Wed Apr  2 23:52:02 PDT 2014
    root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64
Comment 3 Sebastien Pouliot 2014-05-06 15:35:37 UTC
This was fixed yesterday in master d85a9987883f23a491723539004badde4867526b

The workaround (until a fix is released) is to avoid having a space in your build path.

QA: there was a trello card added for adding this as a test case
Comment 4 Radu 2014-06-18 17:07:27 UTC
Hello

This still doesn't seem to be fixed in latest Xamarin version (5.0.1 build 3 - stable channel). Note that this bug forces me to not have spaces in the app name. For some reason the app display name is overriden by the assembly name (this might just be another bug) and since I cannot have spaces in path, it means that I cannot have spaces in the app name either. And app store wants display name to be the same in iTunes connect. This bug is affecting even branding aspects of my product yet it is an easy fix.
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2014-07-11 12:23:20 UTC
## Regression status: REGRESSION

The problem does not occur in Xamarin.Mac 1.6.27.

Given that this is a regression, if there's any chance we could get this backported for the current release cycle, that would be great.


## Alternative  workaround (not recommended): run `mmp` by hand using relative paths

It is technically possible to work around the problem in Xamarin.Mac 1.8.0 by running the `mmp`, `codesign`, and `productbuild` steps by hand. In particular, if you run `mmp` from within the project directory, and use just the _relative_ path to the project's `bin/` folder, then it runs successfully. *But* this is a bit tricky to do correctly. For example you'll need to copy the `ResourceRules.plist` from another successfully-built app into the app bundle before running `codesign`. All in all, moving the solution to a build path that does not contain spaces is likely easier.
Comment 7 Aaron Bockover [MSFT] 2014-07-14 08:47:49 UTC
This patch has landed on the 1.8.1 release branch.
Comment 8 Akhilesh kumar 2014-07-25 12:06:38 UTC
I have checked this issue with latest Xam.Mac 1.8.1.4, I have tested it by creating a new Xam.Mac project in a folder with white space in its name, choosing Release configuration and running the app.

Application build and deploys successfully on release mode without any error.

Screencast: http://screencast.com/t/0ULZV9JS

Xam.Mac 1.8.1.4

Environment info:
=== Xamarin Studio ===

Version 5.2 (build 384)
Installation UUID: ff0c16c6-3c75-46d8-ac56-56c3b56e2c76
Runtime:
	Mono 3.6.0 ((no/f540f8a)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000039

=== Xamarin.Android ===

Version: 4.14.0 (Starter Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Apple Developer Tools ===

Xcode 5.0 (3332.22)
Build 5A1412

=== Xamarin.iOS ===

Version: 7.2.6.26 (Starter Edition)
Hash: f10e5ed
Branch: 
Build date: 2014-07-23 11:06:08-0400

=== Xamarin.Mac ===

Version: 1.8.1.4

=== Build Information ===

Release ID: 502000384
Git revision: 09e06441e39ea272ddda63758fd53013157f7e45
Build date: 2014-07-16 11:15:54-04
Xamarin addins: 2d11dd4dad5b35ca83f24d70e965792a47be8291

=== Operating System ===

Mac OS X 10.9.3
Darwin Apples-iMac.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64

Hence, I am closing this issue.

Please, let me know if I have to check anything else to verify this issue.