Bug 40116 - Fatal Error compiling Forms.Droid with new release 5.10.3 (51) Droid: Error XA0000: Unexpected error - Please file a bug report
Summary: Fatal Error compiling Forms.Droid with new release 5.10.3 (51) Droid: Error X...
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2016-04-05 18:09 UTC by Paul Mace
Modified: 2016-07-28 20:43 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

DIagnostic Build Output (755.32 KB, text/rtf)
2016-04-06 18:34 UTC, Paul Mace

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 Paul Mace 2016-04-05 18:09:50 UTC
Studio Mac 5.10.3 (51)

Error compiling Forms.Droid with new release 

/Users/MacOwner/xProjects/CareRing/Droid: Error XA0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.FileNotFoundException: Could not load assembly 'CareRing.iOS.exe, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? (XA0000) (CareRing.Droid) monodroid

Why on earth is the Droid build interested in CareRing.iOS.exe?!

I Am Hosed--and this was working fine in previous release

Comment 1 Jonathan Pryor 2016-04-06 00:51:37 UTC
> Why on earth is the Droid build interested in CareRing.iOS.exe?!

Good question!

Please provide diagnostic build output and we can figure that out. :-)

Comment 2 Paul Mace 2016-04-06 18:34:31 UTC
Created attachment 15633 [details]
DIagnostic Build Output

Here you go.
Comment 3 Paul Mace 2016-04-06 18:43:10 UTC
One puzzling thing right off the bat: log shows a build of the IOS target.  But this was Right-click menu Build CareRing.Droid.  Not a build all or rebuild all.
Comment 4 Jonathan Pryor 2016-04-06 18:49:14 UTC
...and here's the weird part:

> Target _ResolveLibraryProjectImports needs to be built as output file 'obj/Debug/libraryprojectimports.cache' does not exist.
> Task "ResolveLibraryProjectImports"
> 	Using task ResolveLibraryProjectImports from Xamarin.Android.Tasks.ResolveLibraryProjectImports, Xamarin.Android.Build.Tasks, Version=, Culture=neutral, PublicKeyToken=null
> 	ResolveLibraryProjectImports Task
> 	  ImportsDirectory: library_project_imports
> 	  OutputDirectory: obj/Debug/
> 	  OutputImportDirectory: obj/Debug/__library_projects__/
> 	  UseShortFileNames: False
> 	  Assemblies: 
> 	    /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.dll
> 	    ...
> 	    /Users/MacOwner/xProjects/CareRing/iOS/bin/iPhone/Debug//CareRing.iOS.exe
> 	    ...

Additional context, from Xamarin.Android.Common.targets:


Why is CareRing.iOS.exe referenced? Because it's part of @(ReferencePath) or @(ReferenceDependencyPaths), i.e. one of your project references, somewhere, claims to depend upon CareRing.iOS.exe.

This output is also "interesting":

> 	Done building project "/Users/MacOwner/xProjects/CareRing/iOS/CareRing.iOS.csproj".
> Done executing task "MSBuild"
> Done building target "ResolveProjectReferences" in project "/Users/MacOwner/xProjects/CareRing/Droid/CareRing.Droid.csproj".

This implies that CareRing.Droid.csproj has some kind of project reference to the CareRing.iOS.csproj project, presumably a <ProjectReference/>.

Looking earlier still, I find:

> Done building target "SplitProjectReferencesByExistent" in project "/Users/MacOwner/xProjects/CareRing/Droid/CareRing.Droid.csproj" ("/Library/Frameworks/Mono.framework/Versions/4.2.3/lib/mono/4.5/Microsoft.Common.targets"); "ResolveProjectReferences" depends on it.
> 	Target ResolveProjectReferences:
> 	Task "MSBuild"
> 		Using task MSBuild from Microsoft.Build.Tasks.MSBuild, Microsoft.Build.Tasks.v4.0, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
> 		Global Properties:
> 		Project "/Users/MacOwner/xProjects/CareRing/iOS/CareRing.iOS.csproj" (GetTargetPath target(s)):

which further suggests that CareRing.Droid.csproj has a hard/explicit dependency on the CareRing.iOS.csproj project.
Comment 5 Paul Mace 2016-04-06 19:01:13 UTC
Not a jot of code changed between previous successful compiles and this one. Only change was the 'stable' update.  Checking csproj files.
Comment 6 Paul Mace 2016-04-06 19:03:59 UTC
Droid csproj contained the following

    <ProjectReference Include="..\iOS\CareRing.iOS.csproj">
Comment 7 Paul Mace 2016-04-06 19:08:17 UTC
However removing that clobbered all the Interface references to to base forms project.
Comment 8 Paul Mace 2016-04-11 16:06:44 UTC
Since this was a Forms project, the .csproj ref:

    <ProjectReference Include="..\iOS\CareRing.iOS.csproj">

Should have been a reference to the common code csproj:

    <ProjectReference Include=“..\CareRing\CareRing.csproj">

I never edit these files by hand. And it all compiled nicely before the upgrade to 'stable'. So, how that ref. got clobbered in the upgrade is probably the question that needs answering.

I am back on track but gun-shy about the upcoming 6.0 release

Paul Mace