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
diff --git a/java/aar.go b/java/aar.go
index 0d38e9f..fcdd518 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -186,6 +186,8 @@
 	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...)