VTM does not run on Android 15 with 16 KB page size
VTM does not run on 16 KB page size based Android 15.
It probably needs to rebuild the native libraries for Android.
- https://developer.android.com/guide/practices/page-sizes
- https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html
Are you sure it doesn't work? For me it sounds like it's just an option to use 16 KB pages instead of 4 KB, but not a hard requirement.
@SammysHP
Set up the Android Emulator with a 16-KB-based, Android 15 system image and VTM does not work: https://developer.android.com/guide/practices/page-sizes#16kb-emulator
(it works with regular Android 15 system image)
Even if it was compatible, I just found this notice:
We plan to make 16 KB page compatibility required for app uploads to the Google Play store next year.
(https://developer.android.com/about/versions/15/behavior-changes-all)
I updated the process of building native libraries with #1126.
However, even if we build 16 KB-aligned native libraries with Android instructions, it builds the same native libraries which do not run on Android 15 with 16 KB page size.
If someone knows better, you can try to build the native libraries:
- Set environment variable
NDK_HOME - Update ndk-build with Android instructions for 16 KB page size
- Run
JniBuilder
Hi, Can you tried to build JNI with gdx-jnigen 2.5.2 ? https://github.com/libgdx/gdx-jnigen/pull/73
I do not currently have a working environment for creating native libraries.
You could try building them and if they work correctly, I could merge them. The instructions can be found above.
I think it works with 16 KB....
-
I modified Android.mk and Application.mk then built libs with ndk-build. I modified JniBuilder.java too , but no need this case. In Android.mk add APP_PLATFORM := android-35 add APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true and modify LOCAL_LDLIBS := -lm -llog -Wl,-z,max-page-size=0x4000 I added this, but I think above line is enough LOCAL_LDFLAGS += -Wl,-z,max-page-size=16384 In Application.mk modify APP_PLATFORM := android-35
-
Copy these libs into vtm-android\natives directory
-
Modify build.gradle The androidCompileSdk() and androidTargetSdk() must be 35
-
Build example app...
-
I use x86_64 emulator image with 16kb pagesize. In the emulator's config.ini must add this line as google suggested: kernel.parameters = androidboot.page_shift=14
-
Start emulator ,install example app and start it
@ocsike could you provide those 16k libs?
@ocsike could you provide those 16k libs?
@ztNFny vtmlibs.zip
This zip contains only .so files. I not tried physical device just only x86 emulator.
@ocsike Thanks, I made a quick test on Android 15 emulator 16KB and they seem to work.
But are they only made for Android 15? They do not work on older versions like Android 5. Current .so files work on all Android versions.
Probably need to build them to support all Android versions.
Probably need to use the existing Application.mk with all ABI and platform an old Android.
I built these with the existing Application.mk. I tested on emulators going from Lollipop to Baklava with 16kb page size. Seems to work fine on all of them with the android example app.
Android MK:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := vtm-jni
LOCAL_C_INCLUDES := . libtess2/Include
LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -O2 -Wall -D__ANDROID__ -Wall -O2 -ffast-math -DNDEBUG
LOCAL_CPPFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -O2 -Wall -D__ANDROID__ -Wall -O2 -ffast-math -DNDEBUG
LOCAL_LDLIBS := -lm -llog -Wl,-z,max-page-size=0x4000
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
LOCAL_ARM_MODE := arm
APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true
LOCAL_SRC_FILES := libtess2/Source/dict.c\
libtess2/Source/tess.c\
libtess2/Source/geom.c\
libtess2/Source/bucketalloc.c\
libtess2/Source/mesh.c\
libtess2/Source/sweep.c\
libtess2/Source/priorityq.c\
gl/utils.c\
org_oscim_utils_TessJNI.cpp
include $(BUILD_SHARED_LIBRARY)
@git-bone Thanks! These libs seem to work. 👍
I tested on some old phones with android 9 and 14. Android 5 and 15 (16kb) on emulators. Everything worked fine.
Current native libraries display triangle tessellation artifacts when zoom e.g. north of Boston, UK.
I updated the Libtess library and I created new Android native libraries that should fix tesselation:
- https://github.com/mapsforge/vtm/pull/1178
- https://github.com/mapsforge/vtm/pull/1179
hm. I'm using it now for a couple of weeks, haven't found any issues yet. Is this fix already available when i'm pulling master-snapshot from jitpack?
@git-bone
@MotoUKRider reported this and I could reproduce it also on Android emulator with the mentioned map.
When the pull requests will be merged soon, the snapshot version on Maven and JitPack will include it too.
Technical info: the problem appears because we use themesh="true" tesselation option in land and sea.
We better avoid this option, but Mapsforge / OpenAndroMaps / Freizeitkarte maps use split land polygons that have empty grid space between the land tiles, more as we zoom in. (see image) Mapsforge map engine can easily fill it with stroke, but VTM currently cannot do this.
If we find a way to fix this for VTM, then we can remove the mesh="true" tesselation rule.
@git-bone The triangle artifacts as they appear with the current native libraries north of Boston, UK:
yes, i can reproduce it now. It only seems to happen on certain zoom levels. Never noticed this before.
@git-bone I merged https://github.com/mapsforge/vtm/pull/1179 with the new Android native libraries.
I published version 0.24.0 of VTM with the new Android native libraries on Maven and JitPack repositories.