Bug 31616 - Save failed error when creating Xamarin.Forms app with ampersand in app name.
Summary: Save failed error when creating Xamarin.Forms app with ampersand in app name.
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Xamarin.Forms Add-in ()
Version: 5.9
Hardware: PC All
: Normal normal
Target Milestone: (C7)
Assignee: Matt Ward
URL:
Depends on:
Blocks:
 
Reported: 2015-07-03 05:48 UTC by Matt Ward
Modified: 2016-05-19 09:29 UTC (History)
4 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 Matt Ward 2015-07-03 05:48:32 UTC
To reproduce:

1) File - New - Solution.
2) Select Cross-platform - App - Blank Xamarin.Forms App
3) App Name: MyCoolTips&Tricks.
4) Ensure Android is ticked.
5) Click Next.
6) Remove & from project name and solution name.
7) Click Create.

Expected result:

Xamarin.Forms solution is created without any errors.

Actual result:

Save failed. expected ';' (38) but found "" file:///...AndroidManifest.xml'.
The solution is created but the Android project will not be included in the solution and the projects will be highlighted with "Project not build in active configuration" since the solution creation process was interrupted by the error.

The Xamarin.Forms wizard template need to either block use of special xml characters or perhaps better the templating system should have a way to xml encode the app name so the AndroidManifest.xml file can be created without any errors and still create the label as the user specified.
Comment 1 Matt Ward 2015-07-03 05:58:57 UTC
This also affects the iOS project since the CFBundleDisplayName will be created with an ampersand which breaks the build.
Comment 2 Rajneesh Kumar 2015-07-03 06:07:43 UTC
We are also able to able to reproduce this. To reproduce this issue I have followed the steps and instruction provided in bug description.

Screencast: http://www.screencast.com/t/4w7llasQ

I observed that user gets Save failed. expected ';' (38) but found "" file:///...AndroidManifest.xml'. error and the solution is created but the Android project does't included in the solution.

Ide Logs: https://gist.github.com/Rajneesh360Logica/ff820f5299b4cafd37dd

Environment Info:

=== Xamarin Studio ===

Version 5.9.4 (build 5)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 4.0.2 ((detached/c99aa0c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400020005

=== Xamarin.Android ===

Version: 5.1.4.16 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		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)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.10.2.40 (Business Edition)
Hash: ff5adaa
Branch: master
Build date: 2015-06-30 11:17:03-0400

=== Xamarin.Mac ===

Version: 2.0.2.40 (Business Edition)

=== Build Information ===

Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 3 Matt Ward 2015-07-03 06:24:59 UTC
This has been fixed on a separate branch and should be included in 6.0. The fix implemented is to restrict the characters that can be used for the app name in the New Project dialog.
Comment 4 Arpit Jha 2016-05-19 09:29:41 UTC
I have checked this issue with latest C7 build XS  6.0 (build 5164) and observed that unable to create project having name containing special character.

Screencast:http://www.screencast.com/t/OIWfQBWh

Hence closing this issue.

Environment Info:
https://gist.github.com/Arpit360/d6a19c599a83e7159393a5950b25648c