mediapipe
mediapipe copied to clipboard
Support of 16KB page sizes
Android 15 will now offer support for 16KB page size. Then, all shared libraries shipped within Android apps must be recompiled to support 16KB page size. See documentation :
https://developer.android.com/guide/practices/page-sizes https://source.android.com/docs/core/architecture/16kb-page-size/16kb
I've checked ELF alignment of shared libraries in my project, and result shows that libmediapipe_tasks_vision_jni.so is not aligned : lib/arm64-v8a/libmediapipe_tasks_vision_jni.so: \e[31mUNALIGNED\e[0m (2**12)
This issue is to ask support for Android 16KB page size in mediapipe lib. Thanks
Hi @mimai-hen,
Could you please provide more details about your query regarding support for 16KB pages? We are having difficulties to understand it clearly.
Thank you!!
Hi,
I’ll try to explain. In my Android project I use mediapipe task vision com.google.mediapipe:tasks-vision:0.10.18 for face detection.
When I launch my application on an Android 15 (with 16KB page size) emulator, it crashes when I try using face detection feature :
13:05:37.591 A Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x767d224a47f0 in tid 3371 (xxx.pro.debug), pid 3371 (frica.pro.debug) 13:05:38.007 A pid: 3371, tid: 3371, name: frica.pro.debug >>> xxx.pro.debug <<< 13:05:38.007 A #00 pc 0000000000bc47f0 /data/app/~~L48Lg1SFS4Btj8M5vE4IXw==/xxx.pro.debug-yimG5q0h5w9HtxLEz7xbSw==/lib/arm64/libmediapipe_tasks_vision_jni.so (BuildId: bca8e7908753794146dd5fbd3c1ea403) 13:05:38.007 A #01 pc 0000000000bbee84 /data/app/~~L48Lg1SFS4Btj8M5vE4IXw==/com.orange.money.africa.pro.debug-yimG5q0h5w9HtxLEz7xbSw==/lib/arm64/libmediapipe_tasks_vision_jni.so (BuildId: bca8e7908753794146dd5fbd3c1ea403)
When I launch my application on an Android 15 (with standard 4KB page size) face detection works fine, as well as previous android versions.
In order to make it work on Android 15 (with 16KB page size), some adaptations must be made to native shared libs (here libmediapipe_tasks_vision_jni.so)
Please read carefully android developers guidelines about 16KB memory page size support : https://developer.android.com/guide/practices/page-sizes?hl=en
I apologize if it’s not the right place to ask for this issue to be fixed (in that case, may be you can let me know where I should post this issue)
I hope it’s more clear. Kind regards,
This issue was fixed in tensorflow lite for arm64: https://github.com/tensorflow/tensorflow/issues/69459 Maybe something similar can be done here.
It would also be nice to fix it for other processor architectures: https://github.com/google-ai-edge/LiteRT/issues/43
@schmidt-sebastian @kuaashish Do we have any updates on this issue? It's blocking our app from targeting Android 15.
As an extra point Google Play will require all apps to be compatible on November 1, 2025. So currently any app that uses Mediapipe won't be able to publish updates anymore from November on. http://android-developers.googleblog.com/2025/05/prepare-play-apps-for-devices-with-16kb-page-size.html
Confirming this is also a problem for task-text
lib/arm64-v8a/libmediapipe_tasks_text_jni.so: \e[31mUNALIGNED\e[0m (2**12)
@schmidt-sebastian can you give a status on this issue ? thanks
This issue is also preventing me from updating my app to Android 15. Checked with litert 1.3.0, it still doesn't support 16kb page size.
I'm facing the same issue. Any update?
I believe this library is a wrapper around LiteRT? It looks like LiteRT got a new alpha update (2.0.0-alpha) which introduces 16kb page size.
https://github.com/google-ai-edge/mediapipe/issues/5728
Could we please get an updated version of MediaPipe using the new LiteRT? It should solve this issue, thanks!
upvote
@whhone any update ? we'll soon have to remove face detection from our app because our publication department receives too much warnings from google playstore :-/
We are looking into it. We are hoping to release this in 1 or 2 weeks, as soon as we can.
Please upgrade to the latest version 0.10.26 to get the 16kb page size support.
@whhone Thank you very much, I confirm it is fixed in my application using version 0.10.26
@mimai-hen for stability on x32 devices better use 0.10.26.1
Here's my thread about it: https://github.com/google-ai-edge/mediapipe/issues/6035#issuecomment-3075347838
@whhone i tried to update to latest version but i am still getting the 16kb error
We have updated all of our samples in https://github.com/google-ai-edge/mediapipe-samples to use the new libraries (now 0.10.29) and all of our apps compile with 16 kB alignment. Can you take a look at these?
For anyone stumbling here, the latest major version is indeed 0.10.x and not 0.2023x as some IDE likes to point that out.
More info: https://github.com/google-ai-edge/mediapipe/issues/5588 https://mvnrepository.com/artifact/com.google.mediapipe/tasks-vision