Unsupported for Android 15 - 16KB page size devices
Getting this crash when the app is launched on 16 kb page size device - UnsatisfiedLinkError dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~_YETNo3v4ocKqbIwcLYD7A==/com.athenaone.integration-4gfNKJX5w4mhOsGAGzyOsw==/base.apk!/lib/arm64-v8a/libfast-rsa.so" (new hash type from the future?). The app is crashed on launch only. We would need support for such device from the library as there are some unaligned shared objects that need to be addressed. Any solution for this?
One of the ways would be to bump NDK to 27+, and do the suggested changes as mentioned here - https://developer.android.com/guide/practices/page-sizes
@jakhil232 thanks for report this issue, I'm updating the Android SDK version in rsa-mobile, should be ready later today
@jakhil232 a new version was released, take a look and let me know if works for you https://www.npmjs.com/package/react-native-fast-rsa/v/2.5.1
@jerson The crash was resolved after consuming 2.5.1, but the existing issue is still there which was even there on 2.5.0 - 'ReferenceError: Property 'TextDecoder' doesn't exist'. I think this is reference in other thread as well - #93 . When I downgrade to 2.4.4, the TextDecoder issue is resolved, but since the latest SDK changes are in 2.5.1, I am unable to proceed. Can you please look into this issue as well of TextDecoder?
temporary you can install text-encoding and add this code, I'm gonna be adding a native implementation for it but is gonna take more time
if (typeof global.TextEncoder === 'undefined' || typeof global.TextDecoder === 'undefined') {
require('text-encoding');
}
a new version was published with this fixed: https://www.npmjs.com/package/react-native-fast-rsa/v/2.6.0
I'm going to close this ticket, feel free to reopen it if needed
Hey @jerson I had resumed the work on this thread for 16KB page size support, updated react-native-fast-rsa to the latest version of 2.6.2. Unfortunately, when I am checking the alignment, it is still showing fast-rsa libraries as unaligned. Have a look - /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/app-integration-release_out_XXXXX.3mzgWNp48w/lib/arm64-v8a/libfast-rsa.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/app-integration-release_out_XXXXX.3mzgWNp48w/lib/x86_64/libfast-rsa.so: \e[31mUNALIGNED\e[0m (2**12)
These 2 need to be aligned. Can you please check this once at your end? It would be really great if you take this up on priority as we are kind of stuck with Android imposing the support for 16KB for all play store apps, we are stuck in a loophole.
hi @jakhil232 I will take a look, I remember upgrading to NDK 28 but I will double check if the binaries pass the 16kb validation
@jakhil232 from what I can tell, based on the check_elf_alignment.sh script, both arm64-v8a and x86_64 binaries appear to be aligned correctly.
Here’s a screenshot of the output:
For reference, this is the relevant entry from my yarn.lock:
react-native-fast-rsa@^2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/react-native-fast-rsa/-/react-native-fast-rsa-2.6.2.tgz#dbc518845dcae05bedb49504ab7a2e0c97702285"
integrity sha512-dkR28Sr3yJ9cxe5+hdS34gQ2VGnEC3gSsnsviWVvWxnYcNo6gDhUigPpdjNUhT6DyIwR+HoCK9ZQeGYefZeeTw==
dependencies:
big-integer "^1.6.52"
flatbuffers "24.3.25"
Let me know if you need any additional details.
after looking into this more deeply, it seems the issue is related to the ndkVersion defined in your gradle.properties or build.gradle file.
After updating mine to use NDK r28b, things started working better.
You might want to try updating your configuration like this:
build.gradle
targetSdkVersion = ...
ndkVersion = "28.1.13356709"
kotlinVersion = "...."
or gradle.properties
ndkversion=28.1.13356709
closing this for now, feel free to reopen if needed
APK app-debug.apk is not compatible with 16 KB devices. Some libraries have LOAD segments not aligned at 16 KB boundaries: lib/arm64-v8a/libfast-rsa.so Starting November 1st, 2025, all new apps and updates to existing apps submitted to Google Play and targeting Android 15+ devices must support 16 KB page sizes. For more information about compatibility with 16 KB devices, visit developer.android.com/16kb-page-size.
@jerson
@jerson Only you have the permission to reopen this issue. ### This issue is not fixed, please reopen it!
I am using the most recent version of the library:
"react-native-fast-rsa": "^2.6.2",
I am using only a single method in my app:
const encrypted = await RSA.encryptOAEP(uniqueID, '', Hash.SHA256, publicKey)
When i am uploading my productive app to the Google Play Console, i receive the message, that my App isn't compatible with 16kb devices.
RN root still uses NDK 27.x
according to https://developer.android.com/guide/practices/page-sizes#compile-r27
we need to add -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON into the arguments here https://github.com/jerson/react-native-fast-rsa/blob/6dd6f8e7f036c46686a1c5d5e8cf7033a9dfce10/android/build.gradle#L72
Fixed in PR: https://github.com/jerson/react-native-fast-rsa/pull/97
Thanks @tastydev the PR was merged and included in the latest release