From 129b9ceeb147099a62c46b4ff74670bb1670e34b Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Thu, 7 Feb 2019 12:21:42 +0000 Subject: [PATCH] Workaround dupe resource directories A few apps are co-located with libraries they depend on statically, and because it's not possible to specify "no resource_dirs", they both end up depending on the same resources, leading to downstream problems for RRO generation. Workaround the problem by de-duping the RRO paths for a single app for now. Bug: 124035856 Bug: 123510624 Test: make with enforce_rro == * Change-Id: I251f123eb4280ed72e1ccd2212cb5f3e746e645d --- java/aar.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/aar.go b/java/aar.go index 0d38e9f85..fcdd518b4 100644 --- a/java/aar.go +++ b/java/aar.go @@ -186,6 +186,8 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, ex linkFlags, linkDeps, resDirs, overlayDirs, rroDirs := a.aapt2Flags(ctx, sdkContext, manifestPath) rroDirs = append(rroDirs, staticRRODirs...) + // TODO(b/124035856): stop de-duping when there are no more dupe resource dirs. + rroDirs = android.FirstUniquePaths(rroDirs) linkFlags = append(linkFlags, libFlags...) linkDeps = append(linkDeps, libDeps...)