Bug 35154 - After Nuget upgrade of Xamarin forms and android libraries, unexpected MSBuild errors occur.
Summary: After Nuget upgrade of Xamarin forms and android libraries, unexpected MSBuil...
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-10-22 01:38 UTC by Mike
Modified: 2015-11-13 01:34 UTC (History)
5 users (show)

Tags: BZCU
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 INVALID

Description Mike 2015-10-22 01:38:47 UTC
After updating Xamarin.Forms and Android packages with Nuget in each of my 6 interdependent projects, I get the following unexpected error:

System.IO.FileNotFoundException. Could not load assembly utils (it's a PCL).  The root cause is the following found in Xamarin.Android.Common.Targets:

<Target Name="_ExtractLibraryProjectImports">

	<ResolveLibraryProjectImports
		Assemblies="@(ReferencePath);@(ReferenceDependencyPaths)"
		ImportsDirectory="$(_LibraryProjectImportsDirectoryName)"
		UseShortFileNames="$(UseShortFileNames)"
		OutputDirectory="$(IntermediateOutputPath)"
		OutputImportDirectory="$(IntermediateOutputPath)__library_projects__\">
		<Output TaskParameter="ResolvedResourceDirectories" PropertyName="LibraryResourceDirectories" />
		<Output TaskParameter="ResolvedAssetDirectories" PropertyName="LibraryAssetDirectories" />
		<Output TaskParameter="ResolvedEnvironmentFiles" PropertyName="LibraryEnvironments" />
		<Output TaskParameter="ResolvedResourceDirectoryStamps" PropertyName="_LibraryResourceDirectoryStamps" />
	</ResolveLibraryProjectImports>
</Target>

The message I get when hovering over the tooltip error is:

"The element 'Target' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'ResolveLibraryProjectImports' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Task, AL, AspNetCompiler, AssignCluture, .............. <many more>......."

I also cannot add a reference to Xamarin Forms in one of my projects that I tried to fix up after these errors:
"'Xamarin.Forms 1.5.1.6471' already installed.
Adding 'Xamarin.Forms 1.5.1.6471' to utils.
Could not install package 'Xamarin.Forms 1.5.1.6471'. You are trying to install this package into a project that targets 'portable-net45+sl50+MonoAndroid10+xamarinios10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."
Comment 1 Matt Ward 2015-10-22 04:58:19 UTC
Your PCL project seems to be targeting Profile24 which is not compatible with Xamarin.Forms. The recommended PCL profiles for Xamarin.Forms are 78 and 259. I would try changing the PCL profile to 78 and see if that fixes the build error.

The build error seems to be because it cannot find the utils assembly, which is not being built I would guess since it is not referencing Xamarin.Forms.
Comment 2 Mike 2015-10-23 00:31:56 UTC
Apologies.  I thought I understood these PCL profiles until now.  I finally get it.  There's no bug.

Thanks a lot for your help!
Mike