`filter_zip_exclude` strips test APK classes needed at runtime for instrumentation tests

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

Maintainers usually reply within 6 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
android, java

Research direction

Start at _process_deploy_jar and the filter_zip_exclude behavior described in the issue, then use the linked rules_android-process-crash-repro repository to reproduce the instrumentation test failure. Trace which overlapping .class files are removed from the test APK and verify that the instrumentation test no longer raises ClassNotFoundException at runtime.

Written by the indexing model from the issue text.

Description

When building an instrumentation test with android_binary + instruments, _process_deploy_jar removes all .class files from the test APK that overlap with the app's deploy jar. This causes ClassNotFoundException at runtime because the test APK's classloader can't find classes that were filtered out.

Repro: https://github.com/snazhmudinov/rules_android-process-crash-repro

Dominant language
Java
Stars
205
Forks
113
PR merge metrics
No merged PRs in 30d

Getting set up

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.