Closed mtschirs closed 4 years ago
Does it not make sense to just default to aapt2
here (we support it with the -2
flag at the moment). I have increasingly needed to use this to patch.
@leonjza Good idea. Perhaps you could then introduce another flag to switch back to the old aapt? AFAIK the new aapt2 might throw an error in some cases for which aapt works just fine, so older apps / apps build with an older SDK might require the use of aapt instead of aapt2 (?)
Yeah, basically invert the current default.
@mtschirs want to update the PR to default just to aapt2
?
Feel free to make a fresh PR for this when you have some spare cycles.
Currently, when aapt fails to identify a launchable activity, the AndroidManifest.xml is manually parsed for
<activity-alias>
tags with anandroid.intent.category.LAUNCHER
category.Recently, I observed an issue with aapt failing due to an error
ERROR getting 'android:icon' attribute: attribute is not a string value
. The AndroidManifest.xml contained an<activity>
tag with anandroid.intent.category.LAUNCHER
category, but no<activity-alias>
. Since objection only searches for the later when manually parsing the AndroidManifest.xml, it failed to identify any launchable activity.Moving to aapt2 solved this issue in this case, but I would still like to suggest a more robust manual parsing of AndroidManifest.xml by also scanning for
<activity>
tags.