Skip to content

Commit 90d72eb

Browse files
committed
fix: keep resource-qualifier form in the locale filters
The derived values are handed to aapt2's -c option, which takes Android resource-qualifier form (pt-rBR, zh-rCN) rather than BCP-47 tags. AGP uses a non-empty localeFilters collection verbatim: no validation, no transformation, so pt-BR reached aapt2 and failed resource linking.
1 parent 139efa7 commit 90d72eb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

manager/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ android {
136136
generateLocaleConfig = true
137137
def translated = file("src/main/res").listFiles()
138138
.findAll { it.isDirectory() && it.name ==~ /values-[a-z]{2,3}(-r[A-Z]{2})?/ }
139-
.collect { it.name.substring("values-".length()).replace("-r", "-") }
139+
.collect { it.name.substring("values-".length()) }
140140
def locales = ["en"] + translated
141141
if (translated.isEmpty() || !locales.contains("en")) {
142142
throw new GradleException("Derived locale filters look wrong: ${locales}")

0 commit comments

Comments
 (0)