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