Skip to content

16KB page size alignment failure with Realm on Android (Target SDK 35) #7015

Description

@kadhar03

How frequently does the bug occur?

Always

Description

Issue: 16KB ELF alignment failure with Realm on Android 15 (Target SDK 35)

We are trying to build our React Native app using:

React Native: 0.79.5
Realm JS: 20.1.0
Target SDK: 35 (Android 15)
NDK: r27

We are seeing that the app fails validation on devices with 16KB page size, introduced in Android 15.
On running check_elf_alignment.sh, we see multiple .so libraries (like librealm.so) reported as UNALIGNED with alignment.

We have tried the following:

Added -Wl,-z,max-page-size=16384 linker flag in build.gradle.

Verified that externalNativeBuild is picking the flags.

Used APK Analyzer and confirmed unaligned native libraries.

Please provide an recommended way to build Realm native libraries aligned to 16KB for Android 15+

Stacktrace & log output

APK is not compatible with 16 KB devices. Some libraries have LOAD segments not aligned at 16 KB boundaries:
lib/arm64-v8a/librealm.so

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

20.1.0

What services are you using?

Atlas Device Sync

Are you using encryption?

Yes

Platform OS and version(s)

Android

Build environment

Which debugger for React Native: 0.79.5

Cocoapods version

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions