Open jeraldsun opened 2 years ago
@jeraldsun as a possible fix you could patch the butterknife aar to replace package name to contain .
as expected by Bazel via a genrule
.
I created https://github.com/jeraldsun/BazelAaptButterknifeIssue/pull/1/files which demonstrates this approach. rules_jvm_external
's override_targets
support makes it easier to replace usages automatically.
@jeraldsun as a possible fix you could patch the butterknife aar to replace package name to contain
.
as expected by Bazel via agenrule
.I created https://github.com/jeraldsun/BazelAaptButterknifeIssue/pull/1/files which demonstrates this approach.
rules_jvm_external
'soverride_targets
support makes it easier to replace usages automatically.
@arunkumar9t2 Got it. Thank you very much. I'll have a try.
Description of the bug:
I got a aapt2 error when I ran
bazel build
on my Android project which has both Gradle and Bazel as its build tool:I think the root cause is that the ButterKnife project has a wrong package name to aapt2. But when I use Gradle to build my project, this problem doesn't appear. I'm not sure whether Gradle nor AGP make any tricks here. But it seems that Bazel has many aapt2 error when Gradle works well in my project.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Run
bazel build //src/main:app
at the root of this project: https://github.com/jeraldsun/BazelAaptButterknifeIssueWhich operating system are you running Bazel on?
macOS 12.3.1
What is the output of
bazel info release
?release 5.1.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
https://github.com/bazelbuild/bazel/issues/10527 https://issuetracker.google.com/issues/73450622
Any other information, logs, or outputs that you want to share?
No response