readme.md
1 # Android Asset Packaging Tool 2.0 (AAPT2) release notes
2
3 ## Version 2.17
4 ### `aapt2 compile ...`
5 - Fixed an issue where symlinks would not be followed when compiling PNGs. (bug 62144459)
6 - Fixed issue where overlays that declared `<add-resource>` did not compile. (bug 38355988)
7
8 ## Version 2.16
9 ### `aapt2 link ...`
10 - Versioning of XML files is more intelligent, using a small set of rules to degrade
11 specific newer attributes to backwards compatible versions of them.
12 Ex: `android:paddingHorizontal` degrades to `android:paddingLeft` and `android:paddingRight`.
13
14 ## Version 2.15
15 ### `aapt2 compile ...`
16 - Add `--no-crunch` option to avoid processing PNGs during the compile phase. Note that this
17 shouldn't be used as a performance optimization, as once the PNG is processed, its result is
18 cached for incremental linking. This should only be used if the developer has specially
19 pre-processed the PNG and wants it byte-for-byte identical to the input.
20 NOTE: 9-patches will not be processed correctly with this flag set.
21
22 ## Version 2.14
23 ### `aapt2 link ...`
24 - If an app is building with a minSdkVersion < 26 and a --package-id XX where XX > 7F, aapt2
25 will automatically convert any 'id' resource references from the resource ID 0xPPTTEEEE to
26 0x7FPPEEEE.
27 - This is done to workaround a bug in previous versions of the platform that would validate
28 a resource ID by assuming it is larger than 0. In Java, a resource ID with package ID greater
29 than 0x7F is interpreted as a negative number, causing valid feature split IDs like 0x80010000
30 to fail the check.
31 - '@id/foo' resources are just sentinel values and do not actually need to resolve to anything.
32 Rewriting these resource IDs to use the package ID 7F while maintaining their definitions under
33 the original package ID is safe. Collisions against the base APK are checked to ensure these
34 rewritten IDs to not overlap with the base.
35
36 ## Version 2.13
37 ### `aapt2 optimize ...`
38 - aapt2 optimize can now split a binary APK with the same --split parameters as the link
39 phase.
40
41 ## Version 2.12
42 ### `aapt2 optimize ...`
43 - aapt2 optimize now understands map (complex) values under the type `id`. It ignores their
44 contents and interprets them as a sentinel `id` type. This was added to support existing
45 apps that build with their `id` types as map values.
46 AAPT and AAPT2 always generate a simple value for the type `ID`, so it is unclear how some
47 these apps are encoded.
48
49 ## Version 2.11
50 ### `aapt2 link ...`
51 - Adds the ability to specify assets directories with the -A parameter. Assets work just like
52 assets in the original AAPT. It is not recommended to package assets with aapt2, however,
53 since the resulting APK is post-processed by other tools anyways. Assets do not get processed
54 by AAPT2, just copied, so incremental building gets slower if they are included early on.
55
56 ## Version 2.10
57 ### `aapt2 link ...`
58 - Add ability to specify package ID to compile with for regular apps (not shared or static libs).
59 This package ID is limited to the range 0x7f-0xff inclusive. Specified with the --package-id
60 flag.
61 - Fixed issue with <plurals> resources being stripped for locales and other configuration.
62 - Fixed issue with escaping strings in XML resources.
63
64 ## Version 2.9
65 ### `aapt2 link ...`
66 - Added sparse resource type encoding, which encodes resource entries that are sparse with
67 a binary search tree representation. Only available when minSdkVersion >= API O or resource
68 qualifier of resource types is >= v26 (or whatever API level O becomes). Enabled with
69 `--enable-sparse-encoding` flag.
70 ### `aapt2 optimize ...`
71 - Adds an optimization pass that supports:
72 - stripping out any density assets that do not match the `--target-densities` list of
73 densities.
74 - resource deduping when the resources are dominated and identical (already happens during
75 `link` phase but this covers apps built with `aapt`).
76 - new sparse resource type encoding with the `--enable-sparse-encoding` flag if possible
77 (minSdkVersion >= O or resource qualifier >= v26).
78
79 ## Version 2.8
80 ### `aapt2 link ...`
81 - Adds shared library support. Build a shared library with the `--shared-lib` flag.
82 Build a client of a shared library by simply including it via `-I`.
83
84 ## Version 2.7
85 ### `aapt2 compile ...`
86 - Fixes bug where psuedolocalization auto-translated strings marked 'translateable="false"'.
87
88 ## Version 2.6
89 ### `aapt2`
90 - Support legacy `configVarying` resource type.
91 - Support `<bag>` tag and treat as `<style>` regardless of type.
92 - Add `<feature-group>` manifest tag verification.
93 - Add `<meta-data>` tag support to `<instrumentation>`.
94
95 ## Version 2.5
96 ### `aapt2 link ...`
97 - Transition XML versioning: Adds a new flag `--no-version-transitions` to disable automatic
98 versioning of Transition XML resources.
99
100 ## Version 2.4
101 ### `aapt2 link ...`
102 - Supports `<meta-data>` tags in `<manifest>`.
103
104 ## Version 2.3
105 ### `aapt2`
106 - Support new `font` resource type.
107
108 ## Version 2.2
109 ### `aapt2 compile ...`
110 - Added support for inline complex XML resources. See
111 https://developer.android.com/guide/topics/resources/complex-xml-resources.html
112 ### `aapt link ...`
113 - Duplicate resource filtering: removes duplicate resources in dominated configurations
114 that are always identical when selected at runtime. This can be disabled with
115 `--no-resource-deduping`.
116
117 ## Version 2.1
118 ### `aapt2 link ...`
119 - Configuration Split APK support: supports splitting resources that match a set of
120 configurations to a separate APK which can be loaded alongside the base APK on
121 API 21+ devices. This is done using the flag
122 `--split path/to/split.apk:<config1>[,<config2>,...]`.
123 - SDK version resource filtering: Resources with an SDK version qualifier that is unreachable
124 at runtime due to the minimum SDK level declared by the AndroidManifest.xml are stripped.
125
126 ## Version 2.0
127 ### `aapt2 compile ...`
128 - Pseudo-localization: generates pseudolocalized versions of default strings when the
129 `--pseudo-localize` option is specified.
130 - Legacy mode: treats some class of errors as warnings in order to be more compatible
131 with AAPT when `--legacy` is specified.
132 - Compile directory: treats the input file as a directory when `--dir` is
133 specified. This will emit a zip of compiled files, one for each file in the directory.
134 The directory must follow the Android resource directory structure
135 (res/values-[qualifiers]/file.ext).
136
137 ### `aapt2 link ...`
138 - Automatic attribute versioning: adds version qualifiers to resources that use attributes
139 introduced in a later SDK level. This can be disabled with `--no-auto-version`.
140 - Min SDK resource filtering: removes resources that can't possibly be selected at runtime due
141 to the application's minimum supported SDK level.
142