Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel merges android resource problem #3980

Closed
leozwang-google opened this issue Oct 27, 2017 · 4 comments
Closed

bazel merges android resource problem #3980

leozwang-google opened this issue Oct 27, 2017 · 4 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) type: bug

Comments

@leozwang-google
Copy link

I ran into android resource problems, the errors are
#1. undefined app elevation
#2. undefined some material items, for example widget.design.textinputlayout

The code is attached in this issue.

The code is straightforward, however, it depends on firebase-UI project https://github.com/firebase/FirebaseUI-Android which also depends on faceback and twitter login aars.

fire.zip

@aj-michael aj-michael self-assigned this Nov 10, 2017
@aj-michael aj-michael added P1 I'll work on this now. (Assignee required) category: rules > android type: bug and removed category: rules > android labels Nov 10, 2017
@aj-michael
Copy link
Contributor

/cc @jin @ahumesky @dkelmer

Sorry about the delay on this, I'll try to sort this out early next week.

@aj-michael
Copy link
Contributor

Did some digging, the issue is when Bazel is parsing this stylable attribute:

https://android.googlesource.com/platform/frameworks/support/+/master/design/res/values/attrs.xml#282

Since it doesn't define a format, we assume it a reference instead of a definition. But Bazel can't find an actual definition for it (and neither can I...).

@aj-michael
Copy link
Contributor

Oh, it's inherited from a styleable in appcompat-v7:

https://android.googlesource.com/platform/frameworks/support/+/master/v7/appcompat/res/values/attrs.xml#500

The problem is that maven_aar generates aar_import rules, but there are no deps between those aar_import rules.

This is an ugly manifestation of the fact that Bazel does not have a good solution for transitive maven dependencies.

I'll try and whip up a workaround.

@aj-michael
Copy link
Contributor

so, this issue is a duplicate of #2863.

https://bazel-review.googlesource.com/c/bazel/+/20771 will add a deps attribute to maven_aar that will fix this. However, it will require maintaining the graph of dependencies between the AARs, as opposed to the flat list in the deps of an android_library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants