New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 805668 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
OOO until Feb 4th
Closed: Jan 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

aapt2 doesn't work with current 9-patches

Project Member Reported by wnwen@chromium.org, Jan 24 2018

Issue description

This is the verbose output from aapt2 running on ui_java_resources in process_resources.py

/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-hdpi/dropdown_popup_background_down.9.png: note: compiling PNG.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-hdpi/dropdown_popup_background_down.9.png: note: 9-patch: horizontalStretch: verticalStretch: padding: l=0 t=0 r=0 b
=0, bounds: l=0 t=0 r=0 b=0, outline: l=5 t=4 r=5 b=7 rad=0 alpha=255.
note:  paletteSize=37 alphaPaletteSize=36 maxGrayDeviation=0 grayScale=true.
note: encoding PNG (with 9-patch) as GRAY + ALPHA.
error: 9-patch malformed: No marked region found along edge.
Found along top edge.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-hdpi/dropdown_popup_background_up.9.png: note: compiling PNG.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-hdpi/dropdown_popup_background_up.9.png: note: 9-patch: horizontalStretch: verticalStretch: padding: l=0 t=0 r=0 b=0
, bounds: l=0 t=0 r=0 b=0, outline: l=4 t=7 r=4 b=4 rad=3.4142 alpha=255.
note:  paletteSize=38 alphaPaletteSize=37 maxGrayDeviation=0 grayScale=true.
note: encoding PNG (with 9-patch) as GRAY + ALPHA.
error: 9-patch malformed: No marked region found along edge.
Found along top edge.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-v21/button_borderless_compat.xml: note: compiling XML.                                                              
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-v21/button_compat.xml: note: compiling XML.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-xhdpi/dropdown_popup_background_down.9.png: note: compiling PNG.
error: found an invalid color.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable-xhdpi/dropdown_popup_background_up.9.png: note: compiling PNG.
error: found an invalid color.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable/button_compat_shape.xml: note: compiling XML.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable/dropdown_label_color.xml: note: compiling XML.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable/dropdown_popup_background.xml: note: compiling XML.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable/dropdown_popup_background_down.9.png: note: compiling PNG.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable/dropdown_popup_background_down.9.png: note: 9-patch: horizontalStretch: verticalStretch: padding: l=0 t=0 r=0 b=0, b
ounds: l=0 t=0 r=0 b=0, outline: l=3 t=2 r=3 b=4 rad=0 alpha=255.
note:  paletteSize=26 alphaPaletteSize=25 maxGrayDeviation=0 grayScale=true.
note: encoding PNG (with 9-patch) as GRAY + ALPHA.
error: 9-patch malformed: No marked region found along edge.
Found along top edge.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable/dropdown_popup_background_up.9.png: note: compiling PNG.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/drawable/dropdown_popup_background_up.9.png: note: 9-patch: horizontalStretch: verticalStretch: padding: l=0 t=0 r=0 b=0, bou
nds: l=0 t=0 r=0 b=0, outline: l=2 t=4 r=2 b=2 rad=3.4142 alpha=255.
note:  paletteSize=23 alphaPaletteSize=22 maxGrayDeviation=0 grayScale=true.
note: encoding PNG (with 9-patch) as GRAY + ALPHA.
error: 9-patch malformed: No marked region found along edge.
Found along top edge.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/layout-v17/dropdown_item.xml: note: compiling XML.
/tmp/tmpu660tc/deps/ui_java_resources.resources.zip/layout/dropdown_item.xml: note: compiling XML.
 

Comment 1 by wnwen@chromium.org, Jan 24 2018

Cc: agrieve@chromium.org
Labels: OS-Android
Owner: wnwen@chromium.org
Status: Assigned (was: assiogn)

Comment 2 by wnwen@chromium.org, Jan 25 2018

Here's the diff results for 100kb reduction
diff_results.txt
42.7 KB View Download

Comment 3 by agrieve@google.com, Jan 25 2018

Awesome! Seems legit to me. I had forgot that we excluded 9-patch from the xxxhdpi stripping. 

Comment 4 by wnwen@chromium.org, Jan 25 2018

Update only 45kb saved
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/699e5b95630a74b419bc31dd16e961af434311de

commit 699e5b95630a74b419bc31dd16e961af434311de
Author: Peter Wen <wnwen@chromium.org>
Date: Mon Jan 29 14:57:50 2018

Android: Use aapt2 to crunch pngs

Using aapt to crunch and then avoiding crunching with aapt2's
--no-crunch flag crashes aapt2. Just use aapt2's default crunching.

BUG= 805668 

Change-Id: I61a578eb577069e899cd8a830458d54515fc7d21
Reviewed-on: https://chromium-review.googlesource.com/884064
Commit-Queue: Peter Wen <wnwen@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532427}
[modify] https://crrev.com/699e5b95630a74b419bc31dd16e961af434311de/build/android/gyp/process_resources.py

Comment 6 by wnwen@chromium.org, Jan 29 2018

Status: Fixed (was: Assigned)

Sign in to add a comment