-
-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Unity version 6.0 (6000.0.47f1)
Plugin 'Assets/Plugins/lib/android/arm64/libgilzoide-sqlite-net.so' is not 16KB-aligned. This may cause issues on ARM64 devices running Android 15+.
More info: https://developer.android.com/guide/practices/page-sizes.
System.Linq.Enumerable/WhereEnumerableIterator1<object>:MoveNext () Bee.BeeDriver.BeeDriver:WriteDataForBuildProgram (Bee.BeeDriver.InternalState,System.Threading.Tasks.TaskCompletionSource
1)
Bee.BeeDriver.BeeDriver/<>c__DisplayClass0_0:g__WriteData|0 ()
Bee.BeeDriver.BeeDriver:BuildAsync (Bee.BeeDriver.BuildRequest,System.Threading.CancellationToken)
UnityEditor.EditorApplication:Internal_CallDelayFunctions ()
I tried to make changes via wsl but I did not succeed. It causes problems on Android 15 and above devices, I built it on both Unity and the Redmi 12 Pro device and encountered the same problem.
Activity
gilzoide commentedon May 28, 2025
Hey @MustafaBey654 , thanks for the report. This was supposedly fixed by #64 and should be fixed since version 1.2.3.
Which version of this package are you using?
gilzoide commentedon May 28, 2025
Just ran check_elf_alignment.sh in the ARM64 lib from tag 1.2.4 and it seems to be properly aligned.
MustafaBey654 commentedon May 28, 2025
Hello, the version I am using is https://github.com/gilzoide/unity-sqlite-net.git#1.2.4 and I installed this version in Unity via package manager as a url
gilzoide commentedon May 30, 2025
Well, so you should have an aligned DLL already 🤔
Say, what's that stacktrace you posted in the issue? Is it from the build process? Or is it a log from the client?
MustafaBey654 commentedon Jun 1, 2025
Hello @gilzoide,
Thank you for your previous replies. I have thoroughly followed your suggestions and performed extensive troubleshooting on my end to ensure there are no caching or setup issues.
I used WSL (Windows Subsystem for Linux) to directly inspect the libgilzoide-sqlite-net.so file that Unity is using in my project, located at:
/mnt/d/Unity/PlayStoreGames/DuaUygulamasi/Library/PackageCache/com.gilzoide.sqlite-net@cf7ea3756d7b/Plugins/lib/android/arm64/libgilzoide-sqlite-net.so
As check_elf_alignment.sh is not included in the Unity package, I used the standard Linux tool readelf -S to check the section alignments of the .so file.
Here is the output from readelf -S filtered for relevant sections:
[10] .rodata PROGBITS 000000000000dfb0 0000dfb0
[13] .text PROGBITS 00000000000433c8 0003f3c8
[15] .data.rel.ro PROGBITS 0000000000189200 00181200
[20] .data PROGBITS 000000000018f868 00183868
[21] .bss NOBITS 0000000000193250 00187248
Based on this output, the start addresses of the .rodata, .text, .data.rel.ro, .data, and .bss sections are not aligned to 16KB (0x4000) boundaries. For instance, the .text section starts at 0x433c8 and .rodata at 0xdfb0, neither of which is a multiple of 0x4000.
This directly confirms Unity's warning:
Plugin 'Packages/com.gilzoide.sqlite-net/Plugins/lib/android/arm64/libgilzoide-sqlite-net.so' is not 16KB-aligned. This may cause issues on ARM64 devices running Android 15+.
It seems that the libgilzoide-sqlite-net.so file included in version 1.2.4 (installed via https://github.com/gilzoide/unity-sqlite-net.git#1.2.4) is indeed not 16KB-aligned, despite the previous fixes mentioned.
Could you please investigate this further from your side to ensure the .so files are correctly built with 16KB alignment for Android 15+ compatibility?
Thank you for your time and effort.
gilzoide commentedon Jun 1, 2025
That's weird, check_elf_alignment said it was aligned.

I created a project in Unity 6 to test this and now it tells me the library isn't aligned as well.
So does Android Studio Narwhal's APK analyzer, although it doesn't mark the library as not compatible, but the whole APK.

I'll try upgrading the NDK used to build to r27c and see if it fixes this problem, thanks for bringing this up.
gilzoide commentedon Jun 1, 2025
Well, ok, so I built the library using NDK r27c instead of r26c, nothing seems to have changed. You know what's weirder? The APK installs and runs absolutely fine in a Pixel 9 Pro emulator with 16kb page size I have in Android Studio here, even though Android Studio accuses that the APK does not support 16kb devices 🤷 I'm using the SQLite REPL sample scene, it loads fine, runs SQL statements, all good. I'm quite sure this "Pre-Release 16 KB Page Size Google Play ARM 64 v8a System Image" virtual device instacrashes when I open any app that do not have support for 16kb (I was testing with a real app I work on some time ago).
Unfortunatelly I don't have a real device to test this.
Were you able to complete the build of an APK and try running it in a device with 16kb page size?
MustafaBey654 commentedon Jun 1, 2025
Hi @gilzoide,
Regarding your question about testing on a 16KB page size device:
I built an APK and tested it on my Redmi Note 12 Pro (Snapdragon 732G) running Android 13. Surprisingly, the app seems to run fine without any crashes or obvious issues on this device.
However, as my device is currently on Android 13, it does not use the 16KB page size that Android 15+ will require. My readelf output, Unity's warning, and Android Studio's APK analyzer still confirm that the libgilzoide-sqlite-net.so library is not 16KB-aligned for ARM64.
Additionally, I am also receiving a warning about this exact issue in the Google Play Console when uploading the APK. This confirms that the problem is recognized by Google's distribution platform as well, indicating potential compatibility issues for future devices.
This suggests that the issue might only manifest on devices running Android 15 and newer versions which adopt the 16KB page size requirement.
I hope this information is helpful for your investigation.
Thanks!
MustafaBey654 commentedon Jun 11, 2025
Hi @gilzoide,
I'm writing to follow up on the 16KB alignment issue for Android 15+ devices with the libgilzoide-sqlite-net.so library. I'm actively using this library for my application, and this issue is directly impacting my ability to add new features and proceed with my project's development.
I was wondering if there has been any progress on this matter since our last communication about a week ago. I'm closely monitoring this, especially given the readelf -S outputs showing misalignment and the warnings I'm receiving from the Google Play Console.
Please let me know if there are any updates or if there's anything you'd like me to test on my end. Your help is greatly appreciated.
Best regards
MustafaBey654 commentedon Jun 11, 2025
Hi @gilzoide,
Just wanted to provide an update regarding the 16KB alignment issue.
I've tested the app on a real device, an OPPO A3, which is running ColorOS 15.0 (Android 15). The device uses a Qualcomm Snapdragon 6s Gen1 processor, confirming it's an ARM64 device.
Despite the alignment warnings from Unity and Google Play Console, the application runs without crashing on this Android 15 ARM64 device.
This observation is interesting, as it seems to align with your experience on the Pixel 9 Pro emulator where the app also ran fine despite the warnings.
While the app functions correctly on this device, I'm still receiving the 16KB alignment warning in the Google Play Console, which suggests potential future compatibility issues.
Any further insights or progress on properly aligning the library for Android 15+ devices would be greatly appreciated as I'm waiting for a stable solution to continue adding new features to my project.
Thank you for your continued support!
Best regards
gilzoide commentedon Jun 11, 2025
Hey @MustafaBey654.
Not on my side. Unfortunately I have too many personal projects and not enough time to handle all issues and development of all of them.
Actually, the documentation only says that the LOAD segments should be aligned to 16kb, the check_elf_alignment.sh script linked in the docs confirms the library is properly aligned, I already sent you a screenshot of its output.
To build this package, I'm following the docs on how to build with 16kb page size support. Provided that the Gradle scripts are also compatible, the APK should work. Well, it does actually work, I have tested it in the Android emulator!
I really don't know why Android Studio and Google Play are flaging the library and built APKs as not aligned, since the build just works in devices using 16kb page sizes. Maybe it's a false positive on Google's side 🤷 If it works in the devices, there shouldn't be too much to worry about.
You know, not all devices running Android 15 on ARM64 are configured to use 16kb page sizes at the system level. Did you setup your device to use 16kb page sizes?
I'm not actively looking into this, but I will have to at some point at work (I do work with mobile Unity games in my day job). I'll let you know if I find anything. By the way, I'd also appreciate any new information about this as well, if you ever have any.
Apart from that, it's super easy to ditch the shared libraries and let Unity compile SQLite directly on IL2CPP-enabled builds. That's what iOS and Web builds do. I make native builds for Android because someone might be using the Mono script backend.
gilzoide commentedon Jun 11, 2025
Oh, by the way, I literally just created a new empty project in Unity 2022.3.62, built it for Android, and Android Studio says this APK "does not support 16 KB devices" 🙄
Unity claims 2022.3.56 already supports 16 KB devices in the forum. With this "it works on my device" and "we did everything the docs asked for" experience, I expect this warning to be a false positive for whatever reason. But of course, if it's not, we'll totally fix it before November 1st 2025!
MustafaBey654 commentedon Jun 29, 2025
I'm writing to report a persistent issue I'm encountering with the unity-sqlite-net package regarding Android 15+ 16KB memory page size alignment, even after updating to the latest available versions.
I'm currently using Unity version 6000.0.47f1.
Despite the CHANGELOG.md for version 1.2.3 stating "Fixed: Support for Android 15 devices using 16KB memory page size," and the 1.3.0 update bringing SQLite 3.50.1 and NDK r27c, I'm still consistently getting the following warnings during the Android build process:
Plugin 'Assets/Plugins/Android/libs/x86_64/libgilzoide-sqlite-net.so' is not 16KB-aligned. This may cause issues on X86_64 devices running Android 15+.
More info: https://developer.android.com/guide/practices/page-sizes.
Plugin 'Assets/Plugins/Android/libs/arm64/libgilzoide-sqlite-net.so' is not 16KB-aligned. This may cause issues on ARM64 devices running Android 15+.
More info: https://developer.android.com/guide/practices/page-sizes.
I understand from previous discussions (and your own comments in the Issues section) that this might be a false positive from Unity/Android Studio, or an issue related to Unity's own handling of 16KB alignment for Android builds (even with empty projects).
However, these warnings are still present and concerning, as they suggest potential runtime issues on Android 15+ devices.
Could you please investigate this further, especially considering the specific Unity version I'm using (6000.0.47f1)? Any guidance or potential workarounds would be greatly appreciated.
Thank you for your time and effort.
MustafaBey654 commentedon Jun 29, 2025
Hello, I am using this version as NDK in my Unity 6000.0.47f1 version. Pkg.Desc = Android NDK
Pkg.Revision = 27.2.12479018
Pkg.BaseRevision = 27.2.12479018
Pkg.ReleaseName = r27c
gilzoide commentedon Jun 30, 2025
Hi @MustafaBey654. I understand your concern. To be honest, for me the fact that builds with this package work in the 16kb device (even in the emulator) and the fact that empty Unity builds are marked in Android Studio Narwhal preview as not supporting them is enough to figure out the problem is not in this package itself. Could be in Unity's side, could be in Google's / Android Studio's side, I don't know.
I just pushed a new branch android-build-from-source where the native code is not prebuilt anymore, but rather built from source by Unity (requires IL2CPP). You can install this branch via UPM using the following URL:
This way, Unity is the one controlling how the native build is done, so it uses the exact same NDK and build flags and etcetera that Unity uses. You won't get these warnings anymore because there will not be any prebuilt libraries to warn about, giving you peace of mind. How does that sound to you?