google / google/bundletool

Split assets folder by device ABI

Open
#359 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
4k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
Hello, we are moving WhatsApp to ship with AAB. Our current context is that files under `lib//...` are split properly upon generating APKs, and we'd hope bundletool to have the functionality of splitting `assets` folder by device ABI as well.

More specifically, our bundle structure would be like,
```
/
|-- assets
| |-- compressed
| | |-- x86
| | | |-- libs.spo
| | |-- x86_64
| | | |-- libs.spo
| | |-- arm64-v8a
| | | |-- libs.spo
| | |-- emojis
...
|-- lib
| |-- x86
| |-- x86_64
| |-- arm64-v8a
...
```

**Describe the solution you'd like**
The solution we'd like to have is to split `assets/...//...` (or any format of paths with `` under `assets`) and select the matching ones when generating APKs from bundletool, just like what we do for `lib//...`.

**Describe alternatives you've considered**
We've considered moving all ABI-specific files under `/lib`. However, since we perform custom compression on some native libraries and deal with them with our own runtime logic, this didn't turn out to be a proper fix for the problem due to some Android build system and security concerns. (one example is some OEMs check file names under `/lib` and throw all sorts of errors if it's not a real `.so` file).

**Additional context**
There are similar asks in https://github.com/google/bundletool/issues/190, https://github.com/google/bundletool/issues/180, and https://github.com/google/bundletool/issues/116, but it seems it's not addressed yet.
We'd appreciate your time and effort helping add this functionality, or let us know what it takes to support this in bundletool and we'd like to contribute if possible. Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.