fix(android): pin onnxruntime to 1.22.0 for 16 KB page-size alignment#5
Open
amadeu01 wants to merge 1 commit into
Open
fix(android): pin onnxruntime to 1.22.0 for 16 KB page-size alignment#5amadeu01 wants to merge 1 commit into
amadeu01 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Android 15 introduces 16 KB memory page support (required on Pixel 9+ and future devices). Apps with native libraries not aligned to 16 KB boundaries show an Android App Compatibility warning at launch and will fail alignment checks on devices with 16 KB pages enforced.
Running the app on an Android 15 emulator reports the following unaligned libraries:
Root cause
libonnxruntime.soandlibonnxruntime4j_jni.sooriginate from the transitive dependency:Microsoft added 16 KB page-size alignment support in ONNX Runtime 1.20.0 (see ONNX Runtime Android build docs). Using
latest.releasecan resolve to older artefacts on some Gradle setups, and the floating label makes it impossible to guarantee the fix.Fix
Pin
onnxruntime-androidto1.22.0(current latest, first stable release line with 16 KB support):Remaining issue (needs upstream fix)
libopencv_java4.soandlibappmodules.socome from the prebuilt AARs inside:ai.quickpose:quickpose-mp:0.6ai.quickpose:quickpose-core:0.21These need to be recompiled with
-Wl,-z,max-page-size=16384(or the equivalent NDK CMake flag-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON) and republished to Maven. This cannot be fixed from the React Native wrapper — it requires rebuilding and republishing those Maven artifacts.References