bundletool not properly aligning wrap.sh file
- Dominant language
- Java
- Stars
- 4k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to enable ASAN in a bundle using [these instructions](https://github.com/google/sanitizers/wiki/AddressSanitizerOnAndroid/01f8df1ac1a447a8475cdfcb03e8b13140042dbd#running-with-wrapsh-recommended).
When I add in the `wrap.sh` file as `lib/x86/wrap.sh`, install fails with these adb logs:
```
04-20 01:56:31.898 548 644 E NativeLibraryHelper: Library 'wrap.sh' is not page-aligned - will not be able to open it directly from apk.
04-20 01:56:31.898 548 644 W NativeHelper: Failure copying 32 bit native libraries; copyRet=-2
04-20 01:56:31.898 548 644 E PackageInstallerSession: Commit of session 1685206434 failed: Failed to extract native libraries, res=-2
```
My bundleconfig looks like:
```
{
'optimizations': {
'splitsConfig': {
'splitDimension': split_dimensions,
},
'uncompressNativeLibraries': {
'enabled': True,
'alignment': 'PAGE_ALIGNMENT_16K'
},
'uncompressDexFiles': {
'enabled': True, # Applies only for P+.
}
},
'compression': {
'uncompressedGlob': sorted(uncompressed_globs),
},
}
```
The built `splits/base-master.apk` has:
```
377 Stored 377 0% 1981-01-01 01:01 c81df02f lib/x86/wrap.sh
```
And within the `.aab` it looks like:
```
377 Defl:N 295 22% 2010-01-01 00:00 c81df02f base/lib/x86/wrap.sh
```
Perhaps bundletool is only aligning `.so` files and not all files within `lib/`?
Contributor guide
Assessment
This issue has not been assessed yet.