Status Update
Comments
za...@capitalone.com <za...@capitalone.com> #2
Oops, can't edit it, but meant:
<style name="MyApp.Divider.Horizontal">
<item name="android:layout_height">1dp</item>
<item name="android:layout_width">match_parent</item>
</style>
jv...@google.com <jv...@google.com>
pa...@etrade.com <pa...@etrade.com> #3
di...@google.com <di...@google.com> #4
Thanks for the report.
Having size attributes as part of the style is allowed and should not generate an error. Just to clarify, do you get this error in the editor or when running lint as part of your build?
I've tried in 4.0 RC1 and the project builds and generates no warnings/errors.
If it's part of the build, maybe could you share the build log. If it's happening as part of the editing, could you shared with us the idea.log?
For information on how to obtain the logs, please see
f....@mytaxi.com <f....@mytaxi.com> #5
he...@gmail.com <he...@gmail.com> #6
All of our styles are defined in a core_resources
module, and all my errors came from other modules. I can't share a build log. Sorry.
f....@mytaxi.com <f....@mytaxi.com> #7
Hey!
I just was able to create a repo to reproduce this. If you run ./gradlew lintDebug
it will fail with the reported error message. Looks like the problem is a feature module accessing styles from a shared design module.
ap...@strava.com <ap...@strava.com> #8
he...@careem.com <he...@careem.com> #9
di...@google.com <di...@google.com> #10
Thanks a lot for the repro, it was really helpful.
I can reproduce the problem with the test project, however there is no warning in the Layout Editor. I'm re-assigning the issue to the Lint team.
gh...@google.com <gh...@google.com> #11
Notes:
The RequiredSize
check recently changed from
// Disabled due to false positives in Gradle projects
.setEnabledByDefault(false)
to
.setEnabledByDefault(!LintClient.isGradle())
The problem is: LintClient.isGradle()
is based on a global variable that is not yet initialized when this code runs. So, the RequiredSize
check ends up being enabled even though it shouldn't be.
I'll get a fix in soon.
gh...@google.com <gh...@google.com> #12
Fixed in upcoming 4.1 and 4.2 releases.
The fix did not quite make it in time for 4.0.1. However, you should be able to work around the issue by explicitly disabling the RequiredSize
check.
f....@mytaxi.com <f....@mytaxi.com> #13
Thanks for the fix!
Description
Using AGP 4.0.0-beta05, I get a lint error:
The code in question is:
My
layout_height
andlayout_width
come from my<style>
and are intentionally not specified because I do not want to override the value in the style. is this not allowed anymore?