Recompile your app with 16 KB native library alignment

thats great Scott!!!

1 Like

Has anyone tested on an Android 16KB-emulator? I built the official HelloWorld example(Use newest version 3721) to test in the 16KB-emulator, and it crashed.
Here is the log:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone16k_arm64/emu64a16k:15/AE3A.240806.041/12890756:user/dev-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2025-07-08 16:51:19.177378513+0800
Process uptime: 1s
Page size: 16384 bytes
Cmdline: com.coronalabs.HelloWorld
pid: 7469, tid: 7469, name: labs.HelloWorld  >>> com.coronalabs.HelloWorld <<<
uid: 10206
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x000078b790061548
    x0  b40078b7e70a6f50  x1  0000000000000000  x2  b40078b8c70c1380  x3  0000000000000001
    x4  0000000000002bf6  x5  0000000000000000  x6  0000000000000080  x7  b40078b90064616f
    x8  8900c7a18a941c57  x9  000078b790061000  x10 0000000000000af8  x11 0000000000000006
    x12 b40078b8870c6e50  x13 a219732922521cd5  x14 000000003fffffff  x15 000078ba66528020
    x16 0000000000000001  x17 000078b793c995e4  x18 000078ba67018000  x19 00007ffff14d2048
    x20 000078ba66ac4a80  x21 b40078b8c70c1380  x22 b40078b7e70a6f50  x23 00007ffff14d219c
    x24 b40078b9670bcb50  x25 000078b7900594ec  x26 b40078b7970c0ad0  x27 b40078b7970c0b30
    x28 000078ba66528021  x29 00007ffff14d1f10
    lr  000078b793e7bb58  sp  00007ffff14d1ee0  pc  000078b790059510  pst 0000000060001000
55 total frames
backtrace:
      #00 pc 0000000000011510  /data/app/~~5kLIWDMinyvrjc5JrPk4JQ==/com.coronalabs.HelloWorld-w_ejxVYhkiQHYRx3-e7KYA==/lib/arm64/libjnlua5.1.so (JNI_OnLoad+36) (BuildId: 95f37128d8447ef1fdf31de36746d6713f353df0)
      #01 pc 000000000066bb54  /apex/com.android.art/lib64/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, _jobject*, _jclass*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+1280) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #02 pc 0000000000005914  /apex/com.android.art/lib64/libopenjdkjvm.so (JVM_NativeLoad+356) (BuildId: 52e480f4d160d1f919dafa72cae26e8a)
      #03 pc 000000000009c764  /system/framework/arm64/boot.oat (art_jni_trampoline+148) (BuildId: 73f9b9faa342a487ed24dfeab499cec25d5fd3c1)
      #04 pc 00000000000ab390  /system/framework/arm64/boot.oat (java.lang.Runtime.loadLibrary0+320) (BuildId: 73f9b9faa342a487ed24dfeab499cec25d5fd3c1)
      #05 pc 00000000000ac250  /system/framework/arm64/boot.oat (java.lang.Runtime.loadLibrary0+400) (BuildId: 73f9b9faa342a487ed24dfeab499cec25d5fd3c1)
      #06 pc 00000000000afad4  /system/framework/arm64/boot.oat (java.lang.System.loadLibrary+84) (BuildId: 73f9b9faa342a487ed24dfeab499cec25d5fd3c1)
      #07 pc 000000000077f108  /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #08 pc 0000000000039806  /data/app/~~5kLIWDMinyvrjc5JrPk4JQ==/com.coronalabs.HelloWorld-w_ejxVYhkiQHYRx3-e7KYA==/oat/arm64/base.vdex (com.ansca.corona.JavaToNativeShim.<clinit>+14)
      #09 pc 0000000000369040  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #10 pc 00000000004353cc  /apex/com.android.art/lib64/libart.so (art::ClassLinker::InitializeClass(art::Thread*, art::Handle<art::mirror::Class>, bool, bool)+5260) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #11 pc 0000000000485720  /apex/com.android.art/lib64/libart.so (art::ClassLinker::EnsureInitialized(art::Thread*, art::Handle<art::mirror::Class>, bool, bool)+160) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #12 pc 0000000000353a68  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1564) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #13 pc 000000000037f698  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #14 pc 000000000077f108  /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #15 pc 0000000000032156  /data/app/~~5kLIWDMinyvrjc5JrPk4JQ==/com.coronalabs.HelloWorld-w_ejxVYhkiQHYRx3-e7KYA==/oat/arm64/base.vdex (com.ansca.corona.CoronaEnvironment.setLuaErrorHandler+18)
      #16 pc 000000000077f108  /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #17 pc 0000000000031f10  /data/app/~~5kLIWDMinyvrjc5JrPk4JQ==/com.coronalabs.HelloWorld-w_ejxVYhkiQHYRx3-e7KYA==/oat/arm64/base.vdex (com.ansca.corona.CoronaEnvironment.<clinit>+28)
      #18 pc 0000000000369040  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #19 pc 00000000004353cc  /apex/com.android.art/lib64/libart.so (art::ClassLinker::InitializeClass(art::Thread*, art::Handle<art::mirror::Class>, bool, bool)+5260) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #20 pc 0000000000485720  /apex/com.android.art/lib64/libart.so (art::ClassLinker::EnsureInitialized(art::Thread*, art::Handle<art::mirror::Class>, bool, bool)+160) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #21 pc 0000000000353a68  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1564) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #22 pc 000000000037f698  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #23 pc 000000000077f108  /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #24 pc 000000000002de06  /data/app/~~5kLIWDMinyvrjc5JrPk4JQ==/com.coronalabs.HelloWorld-w_ejxVYhkiQHYRx3-e7KYA==/oat/arm64/base.vdex (com.ansca.corona.CoronaActivity.onCreate+302)
      #25 pc 0000000000489d80  /system/framework/arm64/boot-framework.oat (android.app.Activity.performCreate+944) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #26 pc 0000000000231fa0  /system/framework/arm64/boot-framework.oat (android.app.Instrumentation.callActivityOnCreate+80) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #27 pc 00000000002f9754  /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.performLaunchActivity+2996) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #28 pc 0000000000300624  /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.handleLaunchActivity+884) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #29 pc 0000000000780020  /apex/com.android.art/lib64/libart.so (nterp_helper+4016) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #30 pc 00000000002ffd62  /system/framework/framework.jar (android.app.servertransaction.LaunchActivityItem.execute+170)
      #31 pc 000000000077ffc4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #32 pc 00000000003028e6  /system/framework/framework.jar (android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem+154)
      #33 pc 000000000077ffc4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #34 pc 0000000000302972  /system/framework/framework.jar (android.app.servertransaction.TransactionExecutor.executeTransactionItems+70)
      #35 pc 000000000025fc1c  /system/framework/arm64/boot-framework.oat (android.app.servertransaction.TransactionExecutor.execute+156) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #36 pc 00000000002e8380  /system/framework/arm64/boot-framework.oat (android.app.ActivityThread$H.handleMessage+1840) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #37 pc 00000000005250c8  /system/framework/arm64/boot-framework.oat (android.os.Handler.dispatchMessage+152) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #38 pc 0000000000528134  /system/framework/arm64/boot-framework.oat (android.os.Looper.loopOnce+980) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #39 pc 0000000000527ce4  /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+244) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #40 pc 00000000002f8a04  /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.main+1572) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #41 pc 0000000000369040  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #42 pc 0000000000364a5c  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+732) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #43 pc 00000000006c68c0  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #44 pc 00000000000a2114  /system/framework/arm64/boot.oat (art_jni_trampoline+116) (BuildId: 73f9b9faa342a487ed24dfeab499cec25d5fd3c1)
      #45 pc 00000000007fccf4  /system/framework/arm64/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+116) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #46 pc 0000000000805f24  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+3028) (BuildId: 63f4eb325f3987ae1d20b869e98918cda0bfdf73)
      #47 pc 0000000000369040  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #48 pc 0000000000354568  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+204) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #49 pc 000000000035251c  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+512) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #50 pc 0000000000739788  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+104) (BuildId: 05bfa63ad29b97d7dde4e764ce193f37)
      #51 pc 00000000000d5290  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+104) (BuildId: 7e2a886b7a4523debea27d91258da727)
      #52 pc 00000000000ea74c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+908) (BuildId: 7e2a886b7a4523debea27d91258da727)
      #53 pc 0000000000004568  /system/bin/app_process64 (main+1204) (BuildId: ca426b31a2d06fac00c886329fb5d520)
      #54 pc 00000000000552cc  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+116) (BuildId: 1b9fecf834d610f77e641f026ca7269b)

Of all the plugins I’m using, it seems only Appodeal is causing the issue! For now, I’ve extended the deadline for the warning to November 1. I truly hope it gets resolved smoothly. Thank you always for your support.

Not according to Google

{E53EE8B5-B845-4F8E-BC09-297C8C6CAE27}

Odd is this with recent build version? I just check test app and test 16kb script

What are you using to test? link?

I don’t have a solution yet, I’m just sharing my findings.

Not sure if I understand compressed correctly in the === APK zip-alignment === column, I manually checked the plugin.memoryBitmap v6 so file as per the documentation showing 2**12 (corresponding to 4096), maybe it shows the shared library compressed version when packing or defaults to shared library compression? This is a compatible solution for AGP that cannot be upgraded to 8.5.1 or higher, but I can’t find such a configuration in the Solar2D repository which use AGP 8.8, and the AGP documentation doesn’t seem to find the default configuration for the corresponding version.

$ ~/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump -p 2020.3627-android/jniLibs/arm64-v8a/libplugin.memoryBitmap.so | grep LOAD
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
    LOAD off    0x0000000000001b20 vaddr 0x0000000000002b20 paddr 0x0000000000002b20 align 2**12
$ ~/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump -p 2020.3627-android/jniLibs/x86_64/libplugin.memoryBitmap.so | grep LOAD
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
    LOAD off    0x0000000000001ab0 vaddr 0x0000000000002ab0 paddr 0x0000000000002ab0 align 2**12

Also see:

  1. Android Gradle Plugin 8.1.0 (July 2023) - Native library compression setting moved to DSL
  2. Android Gradle Plugin 4.2.0 (March 2021) - Use the DSL to package compressed native libraries

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 on 64-bit devices.

Another detail is that Google updated the article about two weeks ago, add the 64-bit keyword, so if the 32-bit shared library cannot be supported, it should not be a big problem?

plugin.memoryBitmap has been updated and was showing 2**14 with v7

1 Like

Hi! I have the exact same problem with you. Have you already know where the listed .so files comes from? By which library?

base/lib/arm64-v8a/libtobEmbedPagEncrypt.so
base/lib/arm64-v8a/libpglarmor.so
base/lib/arm64-v8a/libnms.so

It is really important to me. Please! Help!

Do you happen to use the Appodeal Plugin? I tried removing this plugin as a test, and the problem disappeared.

Hi Scott, I hope you’re doing well. I was wondering if you’ve had any further findings or updates regarding the Appodeal-related issue discussed earlier. Any insight you could share would be greatly appreciated. Thank you again for your time and support!

In the process of updating appodeal

2 Likes

I’m wondering if I need to align to 16KB for 32-bit as well?

After investigating, I feel that we shouldn’t compile the 32-bit *.so file (ELF) to 16KB for the following reasons, in order to maintain maximum compatibility:

  1. regarding to Support 16 KB page sizes mentions 64-bit devices and only arm64-v8a or x86_64 libraries need to be recompile.

    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 on 64-bit devices.

    1. If any arm64-v8a or x86_64 shared libraries are UNALIGNED , you’ll need to update the packaging for those libraries, then recompile your app and retest by following the steps in this section.
  2. The NDK Changelog r28

    PAGE_SIZE is no longer defined by default for arm64-v8a or x86_64.

    The default alignment of shared libraries for arm64-v86 and x86_64 is now 16k.

    And the libc++_shared.so inside the 28.1.13356709/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib have 2**12 on arm/i686 and 2**14 on aarch64/x86_64.

  3. From 16 KB page size

    16 KB pages are only supported on arm64 targets with 16 KB kernels.

  4. Also Is the 16KB alignment requirement for 64 bit ABIs?

So should we adjust the align to 16KB for all core *.so and plugin *.so to 64-bit only?
And another issue is that recent 16KB commits may have inadvertently specified that other platforms also align to 16KB, which 16KB requirement is only for Android and the others should be left as is.
What do you think? @Scott_Harrison @vlads @StarCrunch

We’ve also heard feedback that for some of you, recompiling native libraries and upgrading your dependencies is going to take a little longer. You can request an extension until May 31, 2026. After that, all app updates must be compatible with 16 KB memory page sizes.
Clarification of the 16KB page size deadline and information on extensions - Google Play Developer Community

Hello, any updates on that?

@philipp3 is your question about appodeal or 16 kb?

@Scott_Harrison The question is if Appodeal is 16kb ready. I can’t build it with the latest version, because the Applovin adapter produces an error, but maybe that is unrelated.

On iOS, using the latest version of Appodeal still causes a crash when loading ads, so I’m currently in need of Scott’s help to resolve it.
But on Android, I was able to build successfully with the latest version — and in my case, the 16KB alignment issue was resolved as well.

Sorry been busy will try to see if I can find time to knock out iOS

3 Likes