You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: libalphaskiajni.so not compatible with 16 KB page size (Google Play requirement) #68
On Android, the native library libalphaskiajni.so shipped with the alphaTab Android AAR is built with 4 KB LOAD section alignment.
When analyzing my APK / AAB in Android Studio (APK Analyzer / App Bundle Explorer), the following warnings are shown for alphaTab’s native libraries:
• lib/x86_64/libalphaskiajni.so – “4 KB LOAD section alignment, but 16 KB is required”
• lib/arm64-v8a/libalphaskiajni.so – “4 KB LOAD section alignment, but 16 KB is required”
Other native libraries in the same app are already aligned for 16 KB, but the alphaTab library is not, so the app as a whole is reported as not supporting 16 KB devices.
According to Google Play’s new requirements, this will eventually prevent publishing updates for apps that include such libraries on devices with 16 KB page size (Android 16+).
Expected Behavior
alphaTab’s Android artifacts should ship native libraries ( libalphaskiajni.so ) that:
• are compatible with 16 KB page size; and
• pass Android Studio / Google Play checks without “4 KB LOAD section alignment” warnings, so apps using alphaTab can be published/updated for devices with 16 KB page size.
Steps To Reproduce
Create a simple Android app that depends on alphaTab implementation("net.alphatab:alphaTab:1.8.1")
Build an APK (debug or release)
Open the built artifact in Android Studio: Build → Analyze APK
Inspect the lib/arm64-v8a and lib/x86_64 folders
Observe the warnings on libalphaskiajni.so: “4 KB LOAD section alignment, but 16 KB is required”
Link to jsFiddle, CodePen, Project
No response
Version and Environment
alphaTab version: 1.8.1 (net.alphatab:alphaTab from Maven Central)
Platform: Android 16
ABIs: arm64-v8a , x86_64
Tools: Android Studio (APK Analyzer)
Platform
Android (Native)
Anything else?
I’m happy to test any changes or snapshot builds you provide to verify that the updated native libraries work correctly on devices with 16 KB page size and pass the Play/Android Studio checks, and I can report back with results.
Thanks a lot for your work on alphaTab!
Hi! I was able to build alphaSkia’s Android binaries with 16 KB page size support by modifying alphaSkia/externals/skia/gn/skia/BUILD.gn, specifically, the config("default") block:
if (is_android) {
cflags += [ "--sysroot=$ndk/toolchains/llvm/prebuilt/$ndk_host/sysroot" ]
ldflags += [ "-static-libstdc++" ,
# Align native libraries for 16 KB page size systems.
# See https://source.android.com/docs/core/architecture/16kb-page-size/16kb
"-Wl,-z,max-page-size=16384" ]
}
With this change I now get 16 KB–compatible libalphaskiajni.so for Android ABIs arm64-v8a, x86_64, x86 and armeabi-v7a .
However, this lives in the external repo, so I’m not sure if this is the best place to apply the fix for alphaSkia itself. Maybe you could integrate a similar linker flag into your build pipeline, or add your own patch layer on top of Skia, depending on how you prefer to manage third‑party deps.
I did a small check. the newest NDK should normally automatically handle the alignment. Upgrading the NDK and taking the chance to upgrade to the latest Skia mgiht already fix the problem.
I'd expect Skia to have the alignment somehow covered for targeting Android.
You are right. I double-checked this with NDK version 29.0.13846066 and can confirm that no manual fixes are required — simply rebuilding the binaries with the current NDK is sufficient. My earlier patch adding the -Wl,-z,max-page-size=16384 flag turned out to be unnecessary.
From my observations:
With that NDK version, 64-bit binaries (x64, arm64) are built with 16 KB alignment, and 32-bit ones (x86, arm) with 4 KB, which makes sense. However, APK Analyzer incorrectly reports 16 KB alignment for the 32-bit binaries as well, even though that’s not actually the case.
Forcing the -Wl,-z,max-page-size=16384 flag makes 32-bit binaries also use 16 KB alignment, which is probably not desirable.
Try upgrading v3.5.147 to in your project and let me know if things work out for you. In #69 I upgraded to Skia m147 and ensured we use the latest NDK r29. I added a check in the pipeline to ensure the correct page sizes.
I can confirm that with implementation("net.alphatab:alphaSkia-android:3.5.147") the alignment is correct (actually 32-bit binaries have 4 KB alignment).
Activity
AndreiGorelov commentedon Mar 23, 2026
Hi! I was able to build alphaSkia’s Android binaries with 16 KB page size support by modifying
alphaSkia/externals/skia/gn/skia/BUILD.gn, specifically, theconfig("default")block:With this change I now get 16 KB–compatible libalphaskiajni.so for Android ABIs arm64-v8a, x86_64, x86 and armeabi-v7a .
However, this lives in the external repo, so I’m not sure if this is the best place to apply the fix for alphaSkia itself. Maybe you could integrate a similar linker flag into your build pipeline, or add your own patch layer on top of Skia, depending on how you prefer to manage third‑party deps.
Danielku15 commentedon Mar 27, 2026
I did a small check. the newest NDK should normally automatically handle the alignment. Upgrading the NDK and taking the chance to upgrade to the latest Skia mgiht already fix the problem.
I'd expect Skia to have the alignment somehow covered for targeting Android.
AndreiGorelov commentedon Mar 27, 2026
You are right. I double-checked this with NDK version 29.0.13846066 and can confirm that no manual fixes are required — simply rebuilding the binaries with the current NDK is sufficient. My earlier patch adding the
-Wl,-z,max-page-size=16384flag turned out to be unnecessary.From my observations:
APK Analyzerincorrectly reports 16 KB alignment for the 32-bit binaries as well, even though that’s not actually the case.-Wl,-z,max-page-size=16384flag makes 32-bit binaries also use 16 KB alignment, which is probably not desirable.Danielku15 commentedon Mar 28, 2026
It's strange that APK Analyzer reports a 16KB alignment need, from a quick research this is not required (also doesn't make much sense😁 ).
Danielku15 commentedon Mar 28, 2026
Try upgrading v3.5.147 to in your project and let me know if things work out for you. In #69 I upgraded to Skia m147 and ensured we use the latest NDK r29. I added a check in the pipeline to ensure the correct page sizes.
AndreiGorelov commentedon Mar 28, 2026
I can confirm that with
implementation("net.alphatab:alphaSkia-android:3.5.147")the alignment is correct (actually 32-bit binaries have 4 KB alignment).Thank you very much!
AndreiGorelov commentedon Apr 10, 2026
When using the alphaTab 1.8.2 release, the issue has reappeared.
Danielku15 commentedon Apr 10, 2026
alphaTab 1.8.2 does not upgrade alphaSkia references. you need to consume latest alphaSkia in your project.