Bug 43807 - Build FAILED. monodroid error XA0000:
Summary: Build FAILED. monodroid error XA0000:
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 6.1.2 (C7SR1)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2016-08-27 13:23 UTC by Mark
Modified: 2017-06-30 16:29 UTC (History)
3 users (show)

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

This is the droid compile log file tracking the project build. (241.32 KB, text/plain)
2016-08-27 13:23 UTC, Mark

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 43807 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:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Mark 2016-08-27 13:23:03 UTC
Created attachment 17226 [details]
This is the droid compile log file tracking the project build.

Your version field should specify what version identifier you are asking for.


New installation of VS 2015 Pro
New installation of Xamarin
First build of HelloXamarin UWA: portable, multi project application

Lots of pain
Poor documentation
Seen that Xamarin staff has not answered questions on Xamarin site
Am tracking my time spent debugging this issue with you. 
Will send you Microsoft/Xamarin an invoice for time spent fixing this issue.


C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1062,2): monodroid error XA0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.FileNotFoundException: Could not load assembly 'HelloXamarin_V008_PMPA, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
    0 Warning(s)
    1 Error(s)
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2016-08-30 04:24:59 UTC
As indicated by the error message, the "HelloXamarin_V008_PMPA" library is absent at the time the Xamarin.Android project attempts to reference it.

In this case, it appears the problem is that build process is skipping the build of "HelloXamarin_V008_PMPA":

Reformatting to show structure, and prefixing FALSE lines with * 

>  Task "MSBuild" skipped, due to false condition;
>  (
>      '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and
>      '@(ProjectReferenceWithConfiguration)' != '' and
>      ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and
> *    '$(VisualStudioVersion)' == '10.0' and
>      '@(_MSBuildProjectReferenceExistent)' != ''
>  )
>  was evaluated as
>  (
>      'true' == 'true' and 
>      '..\HelloXamarin_V008_PMPA\HelloXamarin_V008_PMPA.csproj' != '' and 
>      ('true' == 'true' or 'true' != 'true') and 
> *    '14.0' == '10.0' and 
>      '..\HelloXamarin_V008_PMPA\HelloXamarin_V008_PMPA.csproj' != ''
>  ).

>  Task "MSBuild" skipped, due to false condition;
>  (
>      '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and 
>      '@(ProjectReferenceWithConfiguration)' != '' and 
> *    '$(BuildingInsideVisualStudio)' != 'true' and 
>      '$(BuildProjectReferences)' == 'true' and 
>      '@(_MSBuildProjectReferenceExistent)' != ''
>  )
>  was evaluated as
>  (
>      'true' == 'true' and 
>      '..\HelloXamarin_V008_PMPA\HelloXamarin_V008_PMPA.csproj' != '' and 
> *    'true' != 'true' and 
>      'true' == 'true' and 
>      '..\HelloXamarin_V008_PMPA\HelloXamarin_V008_PMPA.csproj' != ''
>  ).

>  Task "MSBuild" skipped, due to false condition;
>  (
>      '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and 
>      '@(ProjectReferenceWithConfiguration)' != '' and 
> *    '$(BuildingProject)' == 'true' and 
>      '@(_MSBuildProjectReferenceExistent)' != '')
>  was evaluated as
>  (
>      'true' == 'true' and 
>      '..\HelloXamarin_V008_PMPA\HelloXamarin_V008_PMPA.csproj' != '' and 
> *    'false' == 'true' and 
>      '..\HelloXamarin_V008_PMPA\HelloXamarin_V008_PMPA.csproj' != ''
>  ).

- The first task is skipped because '$(VisualStudioVersion)' is '14.0' rather than '10.0'.

- The second task is skipped because '$(BuildingInsideVisualStudio)' is 'false'

- The third task is skipped because '$(BuildingProject)' is 'false'.

In my very brief local where I did the following:

- Create a new "Visual C# > Cross-Platform > Blank Xaml App (Xamarin.Forms Portable)"

- Run `msbuild /v:diagnostic /t:Build App1\App1.Droid\App1.Droid.csproj` on the command line

It was the _third_ of the MSBuild tasks that ran, so $(BuildingProject) might be the important variable to trace back through the other parts of the build log or project settings.

## Additional notes

- One first quick thing to double-check is that the "Build" checkbox for the "HelloXamarin_V008_PMPA.csproj" project is enabled under "Build > Configuration Manager" for the configuration ("Debug") and platform ("Any CPU") you are using to build the project.

It doesn't look like that's the intended meaning of BuildingProject [1], but it's worth a quick first look anyway.

[1] https://blogs.msdn.microsoft.com/msbuild/2005/11/19/msbuild-in-visual-studio-part-12-compiling-inside-visual-studio/

- You could also try explicitly setting the BuildingProject property to `true` as a diagnostic step to see if it gets switched back to `false` during the build.

(Side note: In Bug 40782, I have requested that this "Could not load assembly" message be replaced with the standard "Metadata file ... could not be found" error that other C# project types produce in this scenario.)