objectbox / objectbox-java

Android Database - first and fast, lightweight on-device vector database
https://objectbox.io
Apache License 2.0
4.38k stars 302 forks source link

recompile objectbox with the new ndk and enable 16k page support #1178

Open andrew-ld opened 3 months ago

andrew-ld commented 3 months ago

android 15 have a breaking changes for all applications, it require the support for 16k page

https://developer.android.com/about/versions/15/behavior-changes-all#16-kb

greenrobot commented 3 months ago

Thanks for bringing this to our attention. Did you try to run ObjectBox on Android 15 yet?

andrew-ld commented 3 months ago

yes, I tried with some pixels I have as test devices, it works but only because the kernel is not compiled with 16k memory pages, when a version with 16k pages should not work anymore.

greenrobot-team commented 3 months ago

Some more details for us:

https://developer.android.com/guide/practices/page-sizes

As device manufacturers continue to build devices with larger amounts of physical memory (RAM), many of these devices will adopt 16 KB

We plan to make 16 KB page compatibility required for app uploads to the Google Play store next year.

Also this sounds like it will only impact new devices?

(Edit: there is an internal issue for this objectbox/objectbox-java#214.)

andrew-ld commented 3 months ago

i opened this issue to be able to get compatibility with this new google requirement as soon as possible, so even apps that i will possibly not maintain in the future will remain compatible with this new requirement

greenrobot commented 3 months ago

Btw, it's an interesting move. Apple also went with 16K pages for iOS. (ObjectBox supports this for quite a while.)

sebastianharder commented 4 weeks ago

When I run my application on a 16 KB page sized emulator, the app crashes when initializing ObjectBox.

Faltenreich commented 4 weeks ago

For us it is the same. On a 4 KB page sized emulator everything works as expected, but our app crashes when being started on an 16 KB page sized emulator, throwing the following exception.

java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~8XEAp4Lnndxc_SHi4DabgA==/de.rewe.app.mobile.debug-nRrVTufzv3fziU8dG5DVLA==/base.apk!/lib/arm64-v8a/libobjectbox-jni.so" (new hash type from the future?)

This seems to be a serious problem as every app (independent of targetSdk) using ObjectBox might break on a device using a page size of 16 KB.

greenrobot commented 4 weeks ago

Is there any device with 16KB pages now available? Btw, Pixel 9 Pro is to be released later today...

Faltenreich commented 4 weeks ago

I did not find any information about the Pixel 9 (Pro) or any other device being shipped with a 16 KB page size.

Surprisingly it seems that the Pixel 6 (Pro) can be flashed with a 16 KB page size according to source.android.com.

andrew-ld commented 3 weeks ago

this issue is more about the future than the present, it is important that apps support this requirement as soon as possible to allow them to be used in the future as well without anyone maintaining them anymore

andrew-ld commented 3 weeks ago

it would also be appreciated if the objectbox source code would be totally published to accelerate these and future developments