Bazel 8 migration - Resources Conflict Handling#206
Open
edwin-grabtaxi wants to merge 1 commit intomigration/bazel_8_main_branchfrom
Open
Bazel 8 migration - Resources Conflict Handling#206edwin-grabtaxi wants to merge 1 commit intomigration/bazel_8_main_branchfrom
edwin-grabtaxi wants to merge 1 commit intomigration/bazel_8_main_branchfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found this error when consumes bazel-common in our sample-android project
In Android, a resource conflict happens when two modules declare a resource with the same name (common) when using resValue in build.gradle to generate build-type or flavor identifiers). Gradle resolves these silently by priority e.g. app/binary resources win over library resources
Without this fix
resource value could silently win.
With this fix
library deps, matching Gradle's resolution order.
Root cause
rules_android 0.7.1 introduced a new Starlark-based resource pipeline (busybox.bzl) with an ACL allowlist (allow_resource_conflicts.bzl) that defaults to empty, making all conflicts hard errors. This replaced Bazel 7's native android_binary which defaulted
throwOnResourceConflict=false. The previous workarounddisable-resource-conflicts.patchinsideall_android_tools_deploy.jarsuppressing warnings inAndroidDataMerger.java, since the new pipeline no longer invokes AndroidDataMerger.Changes
in all workspace modules are treated as warnings instead of errors.
res_values_resources field.
(instead of through kt_android_library dep), giving them binary-level priority in conflict resolution.
priority).