Do not validate localeConfig if it is referenced as external symbol.
Bug: b/258816606
Test: Link_test
Change-Id: I5dd4aa75c02ceebad26d025a99ba302ec673abf8
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index 116dcd6..a8d2299 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -1085,6 +1085,10 @@
const auto localeconfig_entry =
ResolveTableEntry(context_, &final_table_, localeconfig_reference);
if (!localeconfig_entry) {
+ // If locale config is resolved from external symbols - skip validation.
+ if (context_->GetExternalSymbols()->FindByReference(*localeconfig_reference)) {
+ return true;
+ }
context_->GetDiagnostics()->Error(
android::DiagMessage(localeConfig->compiled_value->GetSource())
<< "no localeConfig entry");