Accessing public resources of an Android library that has dependencies on other libraries is producing warning that those resources are marked private
<p>I created a library for Android that itself is dependent on the <code>appcompat</code> and the <code>design</code> support libraries. I have marked all of my library's resources as private by placing a dummy resource in my library's <code>Public.xml</code>:</p>

<pre><code>&lt;public name="string_res_that_does_not_exist" type="string"/&gt;
</code></pre>

<p>When I import my library to another project, Android Studio is producing warnings in lines that were using public resources from the <code>appcompat</code> and <code>design</code> libraries, such as:</p>

<ul>
<li><code>?colorPrimary</code></li>
<li><code>?colorPrimaryDark</code></li>
<li><code>?colorAccent</code></li>
<li><code>?selectableItemBackground</code></li>
</ul>

<p>The warning says <code>The resource @attr/&lt;resource-name&gt; is marked as private in &lt;my-library-name&gt;</code>.</p>

<p>This issue seems related to my problem:
<a href="https://code.google.com/p/android/issues/detail?id=183120" rel="noreferrer">https://code.google.com/p/android/issues/detail?id=183120</a></p>

<blockquote>
  <p>The root cause here is that when a library depends on another library, it imports all the resources from any libraries it depends on into its own declared R.txt (in the AAR file). However, it doesn't include the public.txt declaration from those dependencies, so now it ends up exposing these symbols as declared but not public -- e.g. private.</p>
</blockquote>

<p>How can I prevent these warnings from showing so that other users of my library don't encounter these problems?</p>