Repository navigation
Resource directories missed in incremental builds with AndroidAarLibrary items #2408
Copy link
Copy link
Closed
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.bugComponent does not function as intended.Component does not function as intended.vs-syncFor internal use only; creates a VSTS "mirror" issue.For internal use only; creates a VSTS "mirror" issue.
Milestone
Description
Steps to Reproduce
- Clone
https://github.com/xamarin/Xamarin.Forms.gitand switch to the branchvisual-preview6 nuget.exe restore Xamarin.Forms.slnmsbuild Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj /bl /t:rebuildwhich builds successfullymsbuild Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj /blwhich now fails:
"C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj" (default target) (1) ->
(_UpdateAndroidResgen target) ->
Resources\values\styles.xml(2): error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.MaterialComponents.Light'.
[C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
Resources\values\styles.xml(3): error APT0000: No resource found that matches the given name: attr 'colorAccent'. [C:\xamarin\Xamarin.Forms\Xamarin.Forms.Control
Gallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
Resources\values\styles.xml(2): error APT0000: No resource found that matches the given name: attr 'colorPrimary'. [C:\xamarin\Xamarin.Forms\Xamarin.Forms.Contro
lGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
Resources\values\styles.xml(2): error APT0000: No resource found that matches the given name: attr 'windowActionBar'. [C:\xamarin\Xamarin.Forms\Xamarin.Forms.Con
trolGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
Resources\values\styles.xml(4): error APT0000: No resource found that matches the given name: attr 'windowActionModeOverlay'. [C:\xamarin\Xamarin.Forms\Xamarin.F
orms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
Resources\values\styles.xml(2): error APT0000: No resource found that matches the given name: attr 'windowNoTitle'. [C:\xamarin\Xamarin.Forms\Xamarin.Forms.Contr
olGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
Resources\values\styles.xml(4): error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'. [C
:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
Resources\values\styles.xml(4): error APT0000: No resource found that matches the given name: attr 'colorAccent'. [C:\xamarin\Xamarin.Forms\Xamarin.Forms.Control
Gallery.Android\Xamarin.Forms.ControlGallery.Android.csproj]
It looks like the number of directories specified in the call to Aapt is missing a bunch of items in the incremental build vs the rebuild:

This appears to happen when we use Android Support library nuget packages (in this case 28.0.0-preview6 which have the .aar files directly included in them using the AndroidAarLibrary item group type.
Attaching some binary logs of success/error builds for good measure:
VS bug #752035
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.bugComponent does not function as intended.Component does not function as intended.vs-syncFor internal use only; creates a VSTS "mirror" issue.For internal use only; creates a VSTS "mirror" issue.
Activity
jonathanpeppers commentedon Nov 9, 2018
From the logs this, looks weird
ResolveLibraryProjectImports, on the working one:The broken
ResolveLibraryProjectImports:The input parameters to this task appear to be identical.
dellis1972 commentedon Nov 9, 2018
@jonathanpeppers @Redth I think we need to investigate the .cache files that
ResolveLibraryProjectImportsis exporting on the first run. Make sure it has all the right pathsdellis1972 commentedon Nov 10, 2018
Found the Bug. Its in the Aar extraction code
https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Tasks/ResolveLibraryProjectImports.cs#L400
I'll do a PR
[Xamarin.Android.Build.Tasks] Fix Aar directory resolution.
[Xamarin.Android.Build.Tasks] Fix Aar directory resolution. (#2424)
Revert .aar sideload in nupkg
[Xamarin.Android.Build.Tasks] Fix Aar directory resolution. (dotnet#2424
[Xamarin.Android.Build.Tasks] Fix Aar directory resolution. (#2424) (#…