Skip to content

Resource directories missed in incremental builds with AndroidAarLibrary items #2408

Closed

Description

@Redth

Steps to Reproduce

  1. Clone https://github.com/xamarin/Xamarin.Forms.git and switch to the branch visual-preview6
  2. nuget.exe restore Xamarin.Forms.sln
  3. msbuild Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj /bl /t:rebuild which builds successfully
  4. msbuild Xamarin.Forms.ControlGallery.Android\Xamarin.Forms.ControlGallery.Android.csproj /bl which 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:
image

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:

binlogs.zip

VS bug #752035

Activity

  1. added this to the d16-0 milestone on Nov 9, 2018
  2. added
    bugComponent does not function as intended.
    Area: App+Library BuildIssues when building Library projects or Application projects.
    on Nov 9, 2018
  3. jonathanpeppers commented on Nov 9, 2018

    @jonathanpeppers
    Member

    From the logs this, looks weird ResolveLibraryProjectImports, on the working one:

    LibraryResourceDirectories
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\2\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\4\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\44\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\51\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\55\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\56\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\57\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\79\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\80\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\87\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\89\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\90\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\91\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\92\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\98\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\103\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\104\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\106\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\108\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\109\jl\res
    

    The broken ResolveLibraryProjectImports:

    LibraryResourceDirectories
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\2\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\4\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\44\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\51\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\55\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\56\jl\res
        C:\xamarin\Xamarin.Forms\Xamarin.Forms.ControlGallery.Android\obj\Debug\MonoAndroid90\lp\57\jl\res
    

    The input parameters to this task appear to be identical.

  4. dellis1972 commented on Nov 9, 2018

    @dellis1972
    Contributor

    @jonathanpeppers @Redth I think we need to investigate the .cache files that ResolveLibraryProjectImports is exporting on the first run. Make sure it has all the right paths

  5. dellis1972 commented on Nov 10, 2018

    @dellis1972
    Contributor
  6. added a commit that references this issue on Nov 10, 2018
    e6c76ad
  7. added a commit that references this issue on Nov 12, 2018
    90efbb4
  8. added a commit that references this issue on Nov 13, 2018
  9. added
    vs-syncFor internal use only; creates a VSTS "mirror" issue.
    on Dec 14, 2018
  10. added 2 commits that reference this issue on Dec 20, 2018
    adbe22d
    2cc615a
  11. ghost locked as resolved and limited conversation to collaborators on Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.bugComponent does not function as intended.vs-syncFor internal use only; creates a VSTS "mirror" issue.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions