Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Merge requests
  • !1778

Android: fix aapt processing of aars without res dir.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/lyft/az/fix-aar-no-res-folder into master Feb 15, 2018
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 6

Created by: artem-zinnatullin

Problem:

Google Play Services v11.4.2 and above have special "license" artifacts (aar) that normal artifacts depend on. These "license" aars only have few files in them and no folders, specifically no res folder:

Example:

play-services-base-license-11.8.0.aar:

./AndroidManifest.xml
./third_party_licenses.json
./third_party_licenses.txt

Building Android projects that depend on Google Play Services 11.4.2+ causes following Buck build error:

ERROR: resource directory 'buck-out/bin/prebuilt_aar_without_res/__unpack_play-services-base-license#aar_unzip__/res' does not exist

Build failed: Command failed with exit code 1.
stderr: ERROR: resource directory 'buck-out/bin/prebuilt_aar_without_res/__unpack_play-services-base-license#aar_unzip__/res' does not exist

Fix

This PR fixes problem of non-existing res dir by running MkdirStep during aar unzip which creates empty res folder if it doesn't exist.

Originally I've tried to hook into other places like FilteredResourcesProvider, AndroidBinaryResourcesGraphEnhancer and so on to filter out those non-existing res SourcePaths from going into aapt steps, but that complicated code much more due to different code paths for aapt and aapt2.

Creating empty res dir during unzip looks consistent to existing steps happening during unzip which apply same workaround for assets, proguard config and native libs.

I've also added a test that was failing without the fix.

Fix works with both aapt and aapt2.

cc @kageiit

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/lyft/az/fix-aar-no-res-folder