Bug 42097 - Unclear errors with MSBuild
Summary: Unclear errors with MSBuild
Status: RESOLVED DUPLICATE of bug 40156
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-06-23 03:50 UTC by Mike
Modified: 2017-06-21 23:20 UTC (History)
2 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:
RESOLVED DUPLICATE of bug 40156

Description Mike 2016-06-23 03:50:02 UTC
After upgrading to the latest version of Xamarin Forms which required me to install MSBuild, I can no longer compile my application.  It's probably something silly I've done, but I've been at this for a while now trying to be sure that it's not me.

I'm getting these warnings and errors only in my .Droid projects:  (there are also 2 PCLs in my solution- not that that's important).  I notice that the assembly name for xlabs just strips out the zeroes in front.  That seems a bit odd but maybe that's nothing?  Here are the first few warnings/errors.  What could cause this?

Warning	107	Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="XLabs.Serialization" culture="neutral" publicKeyToken="d65109b36e5040e4" /><bindingRedirect oldVersion="0.0.0.0-2.0.5782.15703" newVersion="2.0.5782.15703" /></dependentAssembly></assemblyBinding>	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	2221	3	choices.Droid

Error	106	The file "obj\Debug\android\bin\packaged_resources" does not exist.	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	1858	3	choices.Droid

Error	105	"aapt.exe" exited with code -1073741819.	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	1832	3	choices.Droid

Warning	104	Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="XLabs.Serialization" culture="neutral" publicKeyToken="d65109b36e5040e4" /><bindingRedirect oldVersion="0.0.0.0-2.0.5782.15703" newVersion="2.0.5782.15703" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /><bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" /></dependentAssembly></assemblyBinding>	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	2221	3	utils.Droid

Error	103	The file "obj\Debug\android\bin\packaged_resources" does not exist.	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	1858	3	utils.Droid

Error	102	"aapt.exe" exited with code -1073741819.	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	1832	3	utils.Droid

Warning	101	The element 'Target' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'Mandroid' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Task, AL, AspNetCompiler, AssignCulture, AssignProjectConfiguration, AssignTargetPath, AxImp, CallTarget, CombinePath, ConvertToAbsolutePath, Copy, CreateCSharpManifestResourceName, CreateItem, CreateProperty, CreateVisualBasicManifestResourceName, Csc, Delete, Error, Exec, FindAppConfigFile, FindInList, FindUnderPath, FormatUrl, FormatVersion, GenerateApplicationManifest, GenerateBootstrapper, GenerateDeploymentManifest, GenerateResource, GenerateTrustInfo, GetAssemblyIdentity, GetFrameworkPath, GetFrameworkSdkPath, GetReferenceAssemblyPaths, LC, MakeDir, Message, Move, MSBuild, ReadLinesFromFile, RegisterAssembly, RemoveDir, RemoveDuplicates, RequiresFramework35SP1Assembly, ResolveAssemblyReference, ResolveComReference, ResolveKeySource, ResolveManifestFiles, ResolveNativeReference, ResolveNonMSBuildProjectOutput, SGen, SignFile, TlbImp, Touch, UnregisterAssembly, UpdateManifest, Vbc, VCBuild, Warning, WriteCodeFragment, WriteLinesToFile, XslTransformation, CodeAnalysis, CL, Link, BSCMake, CPPClean, Get....	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	2448	4	Miscellaneous Files

.....

Thanks a lot for your help with this!

Mike
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2017-06-21 23:08:32 UTC
> "aapt.exe" exited with code -1073741819.
This error can be caused by versions of the `aapt.exe` executable shipped by Google that have bugs.  Certain versions of the Android SDK build-tools have hit this issue at various times in the past (in addition to the duplicate bug report, see for example https://stackoverflow.com/questions/37246892/xamarin-aapt-exe-exited-with-code-1073741819).

*** This bug has been marked as a duplicate of bug 40156 ***
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-06-21 23:20:08 UTC
## Bookkeeping note

Comment 1 is mostly included to give some context for any future users who might come across this bug report first when encountering a similar issue.  The original reporter from Comment 0 would have resolved this issue long ago by updating the Android SDK build-tools.