summaryrefslogtreecommitdiff
path: root/tools/aapt2/cmd/Link.cpp
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-03-23 20:33:04 +0000
committerScott Lobdell <slobdell@google.com>2021-03-24 02:40:01 +0000
commit757dbb836469bbdd7eb8312deaf584fe0c99c17d (patch)
treea678b33ad5f0f024d0f942f127b91665f0616193 /tools/aapt2/cmd/Link.cpp
parent7710a95746be8dba8c6ffe7172f9c01334a2ca81 (diff)
parentf022dd1e6827ebf7c52b06aa40f2059a3f0f5cad (diff)
Merge SP1A.210311.001
Change-Id: Id1a205bf3f0609c0b13e4bea377056c3b06299fa
Diffstat (limited to 'tools/aapt2/cmd/Link.cpp')
-rw-r--r--tools/aapt2/cmd/Link.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index b760958e0edc..13e090d9d843 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -2263,6 +2263,16 @@ int LinkCommand::Action(const std::vector<std::string>& args) {
return 1;
}
+ if (shared_lib_ && options_.private_symbols) {
+ // If a shared library styleable in a public R.java uses a private attribute, attempting to
+ // reference the private attribute within the styleable array will cause a link error because
+ // the private attribute will not be emitted in the public R.java.
+ context.GetDiagnostics()->Error(DiagMessage()
+ << "--shared-lib cannot currently be used in combination with"
+ << " --private-symbols");
+ return 1;
+ }
+
if (options_.merge_only && !static_lib_) {
context.GetDiagnostics()->Error(
DiagMessage() << "the --merge-only flag can be only used when building a static library");