android_library ignores _renamed manifest and still links invalid _generated manifest package
Maintainers usually reply within 6 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- build-system
Research direction
Start at the android_library manifest-generation and manifest-merging entry points, then trace why both _generated and _renamed reach AAPT2. Done means that custom_package or manifest prevents an invalid generated package from being linked and only the correct _renamed manifest is passed to AAPT2.
Written by the indexing model from the issue text.
Description
android_library generates an AndroidManifest with an invalid package name derived from the Bazel target name, and still uses the _generated manifest during manifest merging, even though the _renamed manifest has the correct package.
This results in AAPT2 linking failure.
Actual manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest/>
Build file:
android_library(
name = "lib-facets-constant-debug",
srcs = glob([
"src/main/kotlin/com/arga/merchant/lib/facets/constant/**/*.kt",
]),
custom_package = "com.arga.merchant.lib.facets.constant",
lint_options = {
"enabled": True,
"baseline": "lint-baseline.xml",
},
manifest = "src/main/AndroidManifest.xml",
visibility = [
"//visibility:public",
],
deps = [
"//:parcelize",
"@debug_maven//:androidx_annotation_annotation",
],
)
Generated manifest (_generated):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lib-facets.lib-facets-constant">
<application />
</manifest>
Renamed manifest (_renamed):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arga.merchant.lib.facets.constant" />
Expected behavior:
- When custom_package or manifest is provided, rules_android should not generate or link a manifest with an invalid package name
- _renamed manifest should be the only manifest passed to AAPT2
Actual behavior:
- AAPT2 still links the _generated manifest
- The invalid generated package causes build failure
- Dominant language
- Java
- Stars
- 205
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazelbuild/rules_android
-
build_java8_legacy_dex.sh does not set JAVA_RUNFILES for the d8/r8 launchersPossibly taken @TrapsterDK claimed this 17 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bazelbuild/rules_android#599 ·
Maintainers usually reply within 6 days
-
`Desugar` actions don't run on multiplex workersPossibly taken @lukaciko claimed this 46 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_android#539 · 2 comments ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_android#535 · 2 reactions ·
Maintainers usually reply within 6 days
-
desugar_globals output is not reproducible (zip entry order varies)Possibly taken @TrapsterDK claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
bazelbuild/rules_android#610 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
bazelbuild/rules_android#602 ·
Maintainers usually reply within 6 days
All issues in bazelbuild/rules_android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Lincoln-cn/JAiRouter#1473 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
exercism/java-analyzer#379 ·
-
area: ui bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
tetsuji16/microProject#1893 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
liberation-data/fornax4j#325 ·
Maintainers usually reply within 1 day
-
[Bug]: FE and Kinesis extraction pipes render flow starting at the centre and scroll the source arm backwardsPossibly taken @chonkzillaofficial claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
BCCE-team/BuildCraft#85 ·