Skip to content

tools: update android builds to use 16kb page size - #154

Merged
gmaclennan merged 2 commits into
nodejs-mobile:mainfrom
achou11:148/16kb-alignment
Nov 13, 2025
Merged

tools: update android builds to use 16kb page size#154
gmaclennan merged 2 commits into
nodejs-mobile:mainfrom
achou11:148/16kb-alignment

Conversation

@achou11

@achou11 achou11 commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Fixes #148

Attempts to do the bare minimum in terms of fulfilling the page size requirements required by Google Play. Haven't actually tested this locally, but hoping the workflow on CI can be used to confirm.

Relevant links:

Comment on lines +23 to +25
- { os: ubuntu-22.04, target_arch: arm }
- { os: ubuntu-22.04, target_arch: arm64 }
- { os: ubuntu-22.04, target_arch: x86_64 }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github no longer provides a hosted 20.04 runner image.

matrix:
config:
- { os: ubuntu-20.04 }
- { os: ubuntu-22.04 }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github no longer provides a hosted 20.04 runner image.

- name: Build
env:
MY_ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
LDFLAGS: '-Wl,-z,max-page-size=16384'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achou11 achou11 changed the title tools: update android builds to use 16kb alignment tools: update android builds to use 16kb page size Nov 10, 2025
@achou11

achou11 commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

Downloaded the artifact from https://github.com/nodejs-mobile/nodejs-mobile/actions/runs/19238325194?pr=154 and ran the following:

$ANDROID_SDK_ROOT/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump -p ~/Downloads/x86_64/libnode.so | grep LOAD

which has the following output:

    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**14
    LOAD off    0x00000000015e94c0 vaddr 0x00000000015ed4c0 paddr 0x00000000015ed4c0 align 2**14
    LOAD off    0x00000000032e63f0 vaddr 0x00000000032ee3f0 paddr 0x00000000032ee3f0 align 2**14
    LOAD off    0x000000000340d290 vaddr 0x0000000003419290 paddr 0x0000000003419290 align 2**14

@achou11

achou11 commented Nov 11, 2025

Copy link
Copy Markdown
Contributor Author

Confirming usage of the built assets from this PR works for our app. Screenshots from APK analyzer in Android Studio for a dev apk build:

image image

@gmaclennan
gmaclennan merged commit d9552e0 into nodejs-mobile:main Nov 13, 2025
8 checks passed
gmaclennan added a commit that referenced this pull request Nov 17, 2025
Prepare for release v18.20.4+16kb-fix with the 16kb page alignment from [#154](#154) to address page size alignment requirements for Google Play

Relevant links:

- https://android-developers.googleblog.com/2025/05/prepare-play-apps-for-devices-with-16kb-page-size.html
- https://developer.android.com/guide/practices/page-sizes
@achou11 achou11 mentioned this pull request Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android 16KB Alignment

2 participants