android_library fails on a resource file whose name ends in a period

Open
#564 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
android, java

Research direction

Start by reproducing the minimal android_library example with res/raw/foo. and observe the aapt2 output and missing raw_foo..flat diagnostic. Trace how resource_files names are passed through Android resource compilation, then verify that a trailing-period resource is handled correctly or produces a clearer error.

Written by the indexing model from the issue text.

Description

A resource file whose name ends in a period fails to compile.

Minimal repro:

$ touch res/raw/foo.
android_library(
    name = "lib",
    manifest = "AndroidManifest.xml",
    resource_files = ["res/raw/foo."],
)
java.lang.IllegalArgumentException: .../raw_foo..flat does not exist after aapt2 ran.

I think we can have a better diagnositic info or treat the name correctly like AGP?

Dominant language
Java
Stars
203
Forks
95
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/rules_android

All issues in bazelbuild/rules_android

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.