Bug 59567 - Design-time build fails if project references (indirectly) Xamarin.Build.Download
Summary: Design-time build fails if project references (indirectly) Xamarin.Build.Down...
Status: IN_PROGRESS
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: 8.1 (15.5)
Hardware: PC Mac OS
: High major
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-09-18 18:11 UTC by Jérémie Laval
Modified: 2017-10-05 15:33 UTC (History)
3 users (show)

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


Attachments

Description Jérémie Laval 2017-09-18 18:11:37 UTC
With an Android project referencing support libraries (before 25.4.0.2) or Google Play Services, the UpdateAndroidResources target will fail in an IDE context because less things are now being run (in that case, no ResolveAssemblyReferences) triggering an error with the Xamarin.Build.Download targets that are implicitely referenced by those packages.

Repro: run `msbuild /t:UpdateAndroidResources /p:DesignTimeBuild=true /p:BuildingInsideVisualStudio=true /v:diag AndroidApp.csproj`

Outcome: Xamarin.Build.Download.targets(114,3): error : Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Basement'

Diagnostic log: https://gist.github.com/garuma/294bb5c0f118ff935c40f5e636ec7a2d
Comment 1 Jérémie Laval 2017-09-18 18:12:57 UTC
This has also the effect that the Android designer will constantly show a warning to users that their resources are likely wrong but where a normal build doesn't exhibit the problem.
Comment 2 Jon Dick 2017-09-18 18:38:20 UTC
We have a pull request open which makes Xamarin.Build.Download explicitly depend on `ResolveAssemblyReferences` target so that no matter how our task is invoked, it should ensure the references are resolved first.

https://github.com/xamarin/XamarinComponents/pull/232
Comment 3 Jérémie Laval 2017-09-19 16:57:18 UTC
To update comment #1, Dean referred me to a property the designer can set to revert the target to the older behavior which also means this issue won't show up for the designer.

Note You need to log in before you can comment on or make changes to this bug.