Bug 58075 - Cannot add entitlements to project in path with spaces
Summary: Cannot add entitlements to project in path with spaces
Status: RESOLVED DUPLICATE of bug 56487
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: XI 10.99 (xcode9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-07-11 14:13 UTC by Frank A. Krueger
Modified: 2017-07-12 10:55 UTC (History)
3 users (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 Frank A. Krueger 2017-07-11 14:13:35 UTC
If you add entitlements to an iOS app that has spaces in its path, the arguments to mtouch don't get escaped properly.

It tries to run with this arg: -Xlinker /"/Users/fak/Dropbox/Presentations/20170611 Seattle Mobile iOS 11/Demo11/Demo11/obj/iPhoneSimulator/Debug/device-builds/ipad5.4-11.0/Entitlements.xcent/""

which seems very wrong.

    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --cache "/Users/fak/Dropbox/Presentations/20170611 Seattle Mobile iOS 11/Demo11/Demo11/obj/iPhoneSimulator/Debug/device-builds/ipad5.4-11.0/mtouch-cache" --sim "/Users/fak/Dropbox/Presentations/20170611 Seattle Mobile iOS 11/Demo11/Demo11/bin/iPhoneSimulator/Debug/device-builds/ipad5.4-11.0/Demo11.app" --executable Demo11 --debug --profiling --nolink --sdkroot /Applications/Xcode-beta.app/Contents/Developer --sdk 11.0 --targetver 11.0 --aot-options=-O=-float32 --http-message-handler=HttpClientHandler --abi=x86_64 --symbollist "/Users/fak/Dropbox/Presentations/20170611 Seattle Mobile iOS 11/Demo11/Demo11/obj/iPhoneSimulator/Debug/device-builds/ipad5.4-11.0/mtouch-symbols.list" --dsym=no --gcc_flags "-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /"/Users/fak/Dropbox/Presentations/20170611 Seattle Mobile iOS 11/Demo11/Demo11/obj/iPhoneSimulator/Debug/device-builds/ipad5.4-11.0/Entitlements.xcent/"" -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/mscorlib.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll -r /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --app-extension "/Users/fak/Dropbox/Presentations/20170611 Seattle Mobile iOS 11/Demo11/FileProvider/bin/iPhoneSimulator/Debug/device-builds/ipad5.4-11.0/FileProvider.appex" --target-framework Xamarin.iOS,v1.0 "/Users/fak/Dropbox/Presentations/20170611 Seattle Mobile iOS 11/Demo11/Demo11/bin/iPhoneSimulator/Debug/Demo11.exe" -v -v 

    MTOUCH : error MT0007: The root assembly 'Seattle' does not exist
    MTOUCH : error MT0007: The root assembly 'Mobile' does not exist
    MTOUCH : error MT0007: The root assembly 'iOS' does not exist
    MTOUCH : error MT0007: The root assembly '11/Demo11/Demo11/obj/iPhoneSimulator/Debug/device-builds/ipad5.4-11.0/Entitlements.xcent/' does not exist

=== Visual Studio Enterprise 2017 for Mac (Preview) ===

Version 7.1 Preview (7.1 build 583)
Installation UUID: a0dbb582-a27c-41e5-b0a4-d2a06465b5db
	Mono (2017-04/4a0006f) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000104

=== NuGet ===


=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
SDK: /usr/local/share/dotnet/sdk/2.0.0-preview2-006497/Sdks
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: (Visual Studio Enterprise)
Android SDK: /Users/fak/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b23)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b22, mixed mode)

Android Designer EPL code available here:

=== Xamarin Inspector ===

Version: 1.3.0-alpha2
Hash: fa030e0
Branch: master
Build date: Thu, 01 Jun 2017 20:55:26 GMT
Client compatibility: 1

=== Apple Developer Tools ===

Xcode 9.0 (13199.7)
Build 9M174d

=== Xamarin.iOS ===

Version: (Visual Studio Enterprise)
Hash: 35462f0b
Branch: xcode9
Build date: 2017-07-10 13:20:02-0400

=== Xamarin.Mac ===

Version: (Visual Studio Enterprise)

=== Build Information ===

Release ID: 701000583
Git revision: 445a7f09feca58babb966e0c66a6b299d0bd450c
Build date: 2017-05-12 16:05:38-04
Xamarin addins: f9b72ca5f6ca5d9476d8f58353ada2afd56c549b
Build lane: monodevelop-lion-d15-3-preview

=== Operating System ===

Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

AddinMaker 1.3.7
Xamarin Live Player 1.0.1
Comment 1 Vincent Dondain [MSFT] 2017-07-11 18:45:23 UTC

Unfortunately I can't reproduce this issue locally.

I'm getting: `... -Xlinker "/Users/vidondai/Projects/SeattleMobileiOS11/Seattle Mobile iOS 11/obj/iPhoneSimulator/Debug/device-builds/iphone9.1-11.0/Entitlements.xcent" -u ...`.

Full build output: https://gist.github.com/VincentDondain/e2bbe65ac6c05646e384738ba601683e

I assume the guilty code would be: https://github.com/xamarin/xamarin-macios/blob/master/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs#L316 but it hasn't changed.

This could be related to some other parts of your project, would it be possible for you to give us a small project/test case to reproduce this?

Also please note that I don't think we recommend having spacing in project/solutions names. The new project dialog considers spaces as "illegal" (:
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-07-12 10:55:14 UTC
This looks like a dup of bug #56487: the fix is to use a 15.3 version of mono (it looks like you're using 15.2).

*** This bug has been marked as a duplicate of bug 56487 ***