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 for Bug 56984 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the original description:
In special cases on GitHub you might also want the comments: GitHub Markdown with public comments
The <SubType>Designer</SubType> tag inside the EmbeddedResource tag in a csproj can cause Android to fail compilation. To recreate: -Pull this repo https://ChristianFindlay@bitbucket.org/ChristianFindlay/xamarin-forms-scratch.git -Revert to commit 775749f46267752c27ca58c9b580bb20449d9df7 -Do full Git clean -Open solution Other/Xivic.sln in Visual Studio 2017 -Compile and run Android project -Notice errors Now, -Close Visual Studio -Switch code to commit e9b31e122185208e0588ff35020c63a80641e195 -Full Git Clean -Open solution again -Compile and run Android project -No problem Notice the different between commits 775749f46267752c27ca58c9b580bb20449d9df7 and e9b31e122185208e0588ff35020c63a80641e195 . The only different is the <SubType>Designer</SubType> which are not even in the Android project.
Discussion of bug here: https://forums.xamarin.com/discussion/comment/275833/#Comment_275833
With the given errors I suspected that the designer file had an issue due to the resource type property. On my machine switching the types and compiling in between each self-corrected the issue as I explained in MelbourneDeveloper's thread. While removing these tags corrected the issue, it is suspect that these lines were generated in the first place.
Yes, but the problem isn't so much that the extra lines get added through the IDE, the problem is that if they are there, seemingly random compilation error messages appear. If the tags are invalid for the project type, Visual Studio should validate the project file and complain with a useful error message. Perhaps something along the lines of "Designer is an invalid SubType for a Xamarin Forms XAML file as an EmbeddedResource.".
(In reply to Melbourne Developer from comment #0) > The <SubType>Designer</SubType> tag inside the EmbeddedResource tag in a > csproj can cause Android to fail compilation. > > To recreate: > > -Pull this repo > https://ChristianFindlay@bitbucket.org/ChristianFindlay/xamarin-forms- > scratch.git > -Revert to commit 775749f46267752c27ca58c9b580bb20449d9df7 > -Do full Git clean > -Open solution Other/Xivic.sln in Visual Studio 2017 > -Compile and run Android project > -Notice errors > > Now, > > -Close Visual Studio > -Switch code to commit e9b31e122185208e0588ff35020c63a80641e195 > -Full Git Clean > -Open solution again > -Compile and run Android project > -No problem > > Notice the different between commits > 775749f46267752c27ca58c9b580bb20449d9df7 and > e9b31e122185208e0588ff35020c63a80641e195 . The only different is the > <SubType>Designer</SubType> which are not even in the Android project. Moving this issue for visibility to the Forms product as this seems more dependent on the csproj element <EmbeddedResource>'s property of <SubType> and what gets generated for a XAML file. Perhaps a XAMLC at the assembly level could help this? It does seem to at least see that something inside the Build Action is not supported and gives you a warning, however that warning should be a bit more helpful and straight to the point with regards to the <SubType>. I am CONFIRMING this bug based on reproduction from https://bugzilla.xamarin.com/show_bug.cgi?id=56984#c0 It seems that with these conflicting items, the Resource.Designer.cs is not regenerating and failing which causes the Android errors to appear. This is because it doesn't seem to even make it to the Aapt task in the first place. However removing these <SubType> properties seem to allow compilation past Aapt and a perfectly fine generated Resource.Designer.cs is present.
How is this bug going?