Skip to content

✨ Support 16kb page size for Android 15+ devices #3111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
k-saparia opened this issue Jul 31, 2024 · 12 comments
Closed
2 tasks done

✨ Support 16kb page size for Android 15+ devices #3111

k-saparia opened this issue Jul 31, 2024 · 12 comments
Labels
✨ feature Proposes a new feature or enhancement

Comments

@k-saparia
Copy link

k-saparia commented Jul 31, 2024

What feature or enhancement are you suggesting?

Description

I am encountering issues when running my app on Android 15 devices with a 16 KB page size, particularly with some native components. Are there any plans to recompile the library to address these issues and ensure compatibility with phones that have a 16 KB page size?

As stated on Android doc,

Beginning with Android 15, Android supports devices that are configured to use a page size of 16 KB (16 KB devices). If your app uses any NDK libraries, either directly or indirectly through an SDK, then you will need to rebuild your app for it to work on these 16 KB devices.

An analysis of my app using the APK Analyzer as described by Android shows that it does use libVisionCamera as native code.
image
This is the native binary reported by the APK analysis:

libVisionCamera.so

Describe the solution you'd like

  • I would like for libVisionCamera to support 16kb page size phones so that apps supporting sdk 35 do not crash

Additional context

What Platforms whould this feature/enhancement affect?

Android

Alternatives/Workarounds

No workaround I have investigated so far.

Additional information

@k-saparia k-saparia added the ✨ feature Proposes a new feature or enhancement label Jul 31, 2024
@maintenance-hans maintenance-hans bot changed the title ✨Support 16kb page size for Android 15+ devices ✨ Support 16kb page size for Android 15+ devices Jul 31, 2024
Copy link

maintenance-hans bot commented Jul 31, 2024

Guten Tag, Hans here.

Note

New features, bugfixes, updates and other improvements are all handled mostly by @mrousavy in his free time.
To support @mrousavy, please consider 💖 sponsoring him on GitHub 💖.
Sponsored issues will be prioritized.

@mrousavy
Copy link
Owner

mrousavy commented Aug 1, 2024

should be just a simple flag to CMake, but I think this will break backwards compat

@k-saparia
Copy link
Author

If possible, It should be backward compatible with old and new architecture 🤔 Otherwise, worth to have a force update.

@mrousavy
Copy link
Owner

mrousavy commented Aug 1, 2024

I'm talking about older android SDK/NDK versions

@vishalyad16

This comment was marked as spam.

@mrousavy
Copy link
Owner

This already works in latest VisionCamera afaik

@vioku
Copy link

vioku commented May 9, 2025

same here

@yousrasd
Copy link

Is there an update on this, Google is mandating apps to support 16kb page size by November, this is a blocker for us at the moment

@jesuscc1993
Copy link

If I haven't misunderstood:

Google will enforce targetSdkVersion 35 by Aug 31st 2025.
This is an assumption given they enforced 33 on Aug 31st 2023 and 34 on Aug 31st 2024:
https://support.google.com/googleplay/android-developer/answer/11926878

And they require you to support 16 KB page sizes if you target SDK 2025 so, by extension, every Android app will need to support this by Nov 1st 2025. We can omit the targetSdkVersion 35 part of the requirement as it'll have already been enforced.
https://developer.android.com/guide/practices/page-sizes

Looking at the steps to support this page size, it does not look like this dependency has been updated to do so:
https://developer.android.com/guide/practices/page-sizes
(Unless it's using NDK >= 28, which I was not able to verify).

Regardless, we're still getting the 16KB page size popup using the latest version of this library.

@bobzurad
Copy link

I don't understand why this issue was closed. When I add react-native-vision-camera to my React Native app that targets Android 15, I get the same results as @k-saparia, and I see a popup on my app that says: "This app isn't 16 KB compatible. ELF alignment check failed."

I was able to fix this issue by removing react-native-vision-camera and adding this library instead: https://github.com/teslamotors/react-native-camera-kit/

I also had to apply the patch in this PR: teslamotors/react-native-camera-kit#699

@k-saparia
Copy link
Author

They have created fix for vision camera 16 KB support #3543

@k-saparia
Copy link
Author

k-saparia commented May 29, 2025

However, I fixed by adding support in their cmake file. Here's my patch work!

diff --git a/node_modules/react-native-vision-camera/android/CMakeLists.txt b/node_modules/react-native-vision-camera/android/CMakeLists.txt
index 17097c1..4db203e 100644
--- a/node_modules/react-native-vision-camera/android/CMakeLists.txt
+++ b/node_modules/react-native-vision-camera/android/CMakeLists.txt
@@ -86,3 +86,5 @@ if (ENABLE_FRAME_PROCESSORS)
             react-native-worklets-core::rnworklets
     )
 endif()
+
+target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384")

add this line at the end of library's cmake file

target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature Proposes a new feature or enhancement
Projects
None yet
Development

No branches or pull requests

7 participants