bazelbuild / bazelbuild/rules_android
android_library ignores _renamed manifest and still links invalid _generated manifest package
- Dominant language
- Java
- Stars
- 203
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
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:
```
```
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):
```
```
Renamed manifest (_renamed):
```
```
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
Contributor guide
Assessment
This issue has not been assessed yet.