1

-- EDIT --
I know what xmlns are thank you:)
-- END EDIT --

i can not find any documentation on the res-auto and lib-auto android namespaces. These appears at the top of xml layout files:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:background="#CCCCCC"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

I remarked that aapt2 requires the use of lib-auto instead of res-auto. But don't know why.

xmlns:app="http://schemas.android.com/apk/lib-auto"

And what if you don't have any xml layout file, and you still need to include all resources from a library. What would be the "code" version of lib-auto ?

Softlion
  • 12,281
  • 11
  • 58
  • 88
  • Possible duplicate of [What does "xmlns" in XML mean?](https://stackoverflow.com/questions/1181888/what-does-xmlns-in-xml-mean) – Daniel Sep 19 '19 at 09:38
  • nope. I precised the question. – Softlion Sep 19 '19 at 09:50
  • please read the answers, those namespaces are used to distinguish specific namespaces used by android when xml gets parsed into code. If you try to go one of links you will see that they are dead, since they are just used as unique namespaces used by android xml parser. – Daniel Sep 19 '19 at 10:08
  • please read the complete question. Especially what if you don't have any xml layout file. – Softlion Sep 19 '19 at 10:25
  • aapt2 does not require a 'lib-auto' namespace, one like that doesn't exist. :) Using "xmlns:app="http://schemas.android.com/apk/res-auto"" tells aapt2 to use the package of the app for all of the resources (and since they're all merged into the app module they all exist within this namespace). – Izabela Orlowska Sep 20 '19 at 15:24
  • well @IzabelaOrlowska without lib-auto, the resources from the included libraries are not included in the final bundle. – Softlion Oct 06 '19 at 17:40

0 Answers0