Fixed
Status Update
Comments
ja...@gmail.com <ja...@gmail.com> #2
Now that aapt2 is being actively developed this might be a good time to adjust this behavior and leave aapt1 with the old behavior.
au...@google.com <au...@google.com>
ja...@google.com <ja...@google.com>
ja...@google.com <ja...@google.com> #3
Fixed by I8fb950731383f86bee225333bda27baf5a7a34c5. Will comment on AGP version once known.
ja...@gmail.com <ja...@gmail.com> #4
Shipped in 3.3.0-alpha05
ja...@google.com <ja...@google.com> #5
Re-opening because this was reverted and put behind a flag that you cannot enable in AGP. Therefore: still broken! It should be on by default in AGP with a flag to enable the old, incorrect behvior.
ja...@google.com <ja...@google.com> #6
This should be in AGP 3.6 alpha 07 as android.useMinimalKeepRules=true in your gradle.properties.
I'll keep this open to track the flag being enabled by default in AGP 3.7 and then the flag removed in AGP 3.8.
ja...@google.com <ja...@google.com> #7
These will be enabled by default in AGP 4.0 alpha 05. You will be able to use android.useMinimalKeepRules=false in your gradle.properties to opt out, if required.
Description
# view AndroidManifest.xml #generated:71
-keep class com.example.ExampleApp { <init>(...); }
# view AndroidManifest.xml #generated:139
-keep class com.example.ExampleGcmService { <init>(...); }
# view res/layout/birthday_view.xml #generated:2
-keep class com.example.ui.BirthdayView { <init>(...); }
While these serve to keep the constructors that are invoked reflectively, the use of `...` cause additional constructors to sometimes be needlessly retained.
Entries generated from AndroidManifest.xml should be changed to `<init>()` and entries from layout XMLs should be changed to `<init>(android.content.Context,android.util.AttributeSet)`.
If those constructors call other constructors (such as is often found in the case of views) then they will be automatically retained anyway. In the case where `super()` is called and the other constructors are not referenced it correctly allows them to be stripped as unused instead of needlessly retained.