bundletool icon indicating copy to clipboard operation
bundletool copied to clipboard

bundletool not properly aligning wrap.sh file

Open agrieve opened this issue 10 months ago • 0 comments

I'm trying to enable ASAN in a bundle using these instructions.

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/?

agrieve avatar Apr 20 '24 02:04 agrieve