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

Issue 632362 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocking:
issue 607761



Sign in to add a comment

android_aar() targets cause android lint errors for third_party resources

Project Member Reported by agrieve@chromium.org, Jul 28 2016

Issue description

Building chrome_java produces many lint errors like:

out-gn/Debug/gen/third_party/android_tools/android_support_design_java/res/layout/design_navigation_item.xml:21 Consider adding `android:paddingStart="?attr/listPreferredItemPaddingLeft"` to better support right-to-left layouts: RtlHardcoded [warning]
        android:paddingLeft="?attr/listPreferredItemPaddingLeft"
        ~~~~~~~~~~~~~~~~~~~
out-gn/Debug/gen/third_party/android_tools/android_support_design_java/res/layout/design_navigation_item.xml:22 Consider adding `android:paddingEnd="?attr/listPreferredItemPaddingRight"` to better support right-to-left layouts: RtlHardcoded [warning]
        android:paddingRight="?attr/listPreferredItemPaddingRight"
        ~~~~~~~~~~~~~~~~~~~~
out-gn/Debug/gen/third_party/android_tools/android_support_design_java/res/layout/design_navigation_item_subheader.xml:22 Consider adding `android:paddingStart="?attr/listPreferredItemPaddingLeft"` to better support right-to-left layouts: RtlHardcoded [warning]
          android:paddingLeft="?attr/listPreferredItemPaddingLeft"
          ~~~~~~~~~~~~~~~~~~~
out-gn/Debug/gen/third_party/android_tools/android_support_design_java/res/layout/design_navigation_item_subheader.xml:23 Consider adding `android:paddingEnd="?attr/listPreferredItemPaddingRight"` to better support right-to-left layouts: RtlHardcoded [warning]
          android:paddingRight="?attr/listPreferredItemPaddingRight"
          ~~~~~~~~~~~~~~~~~~~~

These are caused because chrome_java is a direct dependency on the .aar's resources, rather than depending on them indirectly through the .aar's java_prebuilt() target.

I don't see an way to fix this without having aar targets write a custom build_config.
 

Comment 1 by ian...@chromium.org, Jul 28 2016

These lint errors seem to complain about some nits in the support library source code. Shall we disable lint for support lib targets?
Can you paste an example of where it's linting the source code? I didn't think there was even any source code to complain about in the prebuilts...
I was wrong about needing a custom build_config to fix this. Fix is actually quite simple:
https://codereview.chromium.org/2190283002/
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 29 2016

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

commit 0d2b6f00cd29a9ac44af44212a8f53cd0e0c9de3
Author: agrieve <agrieve@chromium.org>
Date: Fri Jul 29 23:09:31 2016

Fix android_aar resources causing lint warnings

Just needed to make the aar's java_prebuilt targets depend on the
resource targets so that would be deemed the resource owners within
write_build_config.py

BUG= 632362 

Review-Url: https://codereview.chromium.org/2190283002
Cr-Commit-Position: refs/heads/master@{#408798}

[modify] https://crrev.com/0d2b6f00cd29a9ac44af44212a8f53cd0e0c9de3/build/config/android/rules.gni

Status: Fixed (was: Assigned)

Sign in to add a comment