⚠️ Support for Android 16 KB page size
Hi @baronha , First of all, thank you for this awesome library and all your efforts in maintaining it 🙏
Background
Google has announced that by November 1, 2025, all native libraries published to Google Play must support a 16 KB page size. Reference: Page Size Support Documentation
Currently, when building with latest version of react-native-multiple-image-picker (2.2.3), the following warnings appear:
libMultipleImagePicker.so - 4KB load section alignment, but 16 KB is required. libimage_processing_util_jni.so - 4KB load section alignment, but 16 KB is required.
Investigation
Based on the discussion here: • Google Issue Tracker • CameraX Developers Group
It seems that: • libimage_processing_util_jni.so is bundled with androidx.camera:camera-core. • Versions 1.2.x / 1.3.x of CameraX were compiled with 4KB page size alignment, causing the warning. • This is fixed starting from CameraX 1.4.0.
Dependency Analysis
react-native-multiple-image-picker doesn’t pull CameraX directly but instead depends on:
implementation 'io.github.lucksiege:camerax:v3.11.2'
From dependency resolution:
io.github.lucksiege:camerax:v3.11.2 ↳ androidx.camera:camera-view:1.2.1 ↳ androidx.camera:camera-core:1.2.1
This confirms that the library currently uses CameraX 1.2.1, which does not support 16KB page size.
Could you please make the changes to make this library 16kb Page size compatible.
io.github.liyuhaolol:camerax:v3.11.5
Seems to offer 16kb support.
For more info, https://github.com/liyuhaolol/PictureSelector
Tôi cũng đang gặp vấn đề này
To achieve compatibility with 16KB memory pages in this package, you need to do the following:
- Navigate to the directory
../node_modules/@baronha/react-native-multiple-image-picker/android - Open the file
CMakeLists.txtfor editing and add the following lines to the end of the file:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384")
- Then navigate to the directory
../node_modules/react-native-nitro-modules/android - Open the file
CMakeLists.txtfor editing and add the following lines to the end of the file:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384")
PS: In both directories, delete the .cxx directory before building for a clean build.
I tested with package version 2.2.4, react-native-nitro-modules version 0.29.8, and RN 0.79.
要使此软件包与 16KB 内存页兼容,您需要执行以下操作:
- 导航至该目录
../node_modules/@baronha/react-native-multiple-image-picker/android- 打开文件
CMakeLists.txt进行编辑,并在文件末尾添加以下几行:set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384")
- 然后导航到该目录
../node_modules/react-native-nitro-modules/android- 打开文件
CMakeLists.txt进行编辑,并在文件末尾添加以下几行:set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384")PS:在两个目录中,
.cxx构建之前请删除目录,以确保构建过程干净。我使用软件包版本 2.2.4、react-native-nitro-modules 版本 0.29.8 和 RN 0.79 进行了测试。
ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors) clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.
C++ build system [build] failed while executing:
/Users/Zhuanz/Library/Android/sdk/cmake/3.22.1/bin/ninja
-C
/Users/Zhuanz/Desktop/test/test-app/node_modules/react-native-nitro-modules/android/.cxx/Debug/k4d3k4w3/arm64-v8a
NitroModules
from /Users/Zhuanz/Desktop/test/test-app/node_modules/react-native-nitro-modules/android
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 37s 986 actionable tasks: 348 executed, 604 from cache, 34 up-to-date Error: /Users/Zhuanz/Desktop/test/test-app/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a exited with non-zero code: 1 Error: /Users/Zhuanz/Desktop/test/test-app/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a exited with non-zero code: 1 at ChildProcess.completionListener (/Users/Zhuanz/Desktop/test/test-app/node_modules/@expo/spawn-async/src/spawnAsync.ts:67:13) at Object.onceWrapper (node:events:634:26) at ChildProcess.emit (node:events:519:28) at maybeClose (node:internal/child_process:1105:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5) ... at spawnAsync (/Users/Zhuanz/Desktop/test/test-app/node_modules/@expo/spawn-async/src/spawnAsync.ts:28:21) at spawnGradleAsync (/Users/Zhuanz/Desktop/test/test-app/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:134:28) at assembleAsync (/Users/Zhuanz/Desktop/test/test-app/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:83:16) at runAndroidAsync (/Users/Zhuanz/Desktop/test/test-app/node_modules/@expo/cli/src/run/android/runAndroidAsync.ts:62:24) error Command failed with exit code 1.
I successfully packaged the application once without any problems, but this error occurred later. I've tried clearing the cache, deleting modules, deleting the android directory, and rebuilding, but the same error still occurs. Why?