mapsforge / vtm

OpenGL vector map library - running on Android, iOS, Desktop and browser.
GNU Lesser General Public License v3.0
272 stars 89 forks source link

VTM does not run on Android 15 with 16 KB page size #1125

Open devemux86 opened 5 months ago

devemux86 commented 5 months ago

VTM does not run on 16 KB page size based Android 15.

It probably needs to rebuild the native libraries for Android.

SammysHP commented 5 months ago

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.

devemux86 commented 5 months ago

@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)

SammysHP commented 5 months ago

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)

devemux86 commented 5 months ago

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:

ocsike commented 1 month ago

Hi, Can you tried to build JNI with gdx-jnigen 2.5.2 ? https://github.com/libgdx/gdx-jnigen/pull/73

devemux86 commented 1 month ago

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.

ocsike commented 1 month ago

I think it works with 16 KB....

  1. 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

  2. Copy these libs into vtm-android\natives directory

  3. Modify build.gradle The androidCompileSdk() and androidTargetSdk() must be 35

  4. Build example app...

  5. 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

  6. Start emulator ,install example app and start it vtm2

ztNFny commented 1 week ago

@ocsike could you provide those 16k libs?

ocsike commented 1 week ago

@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.

devemux86 commented 1 week ago

@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.

devemux86 commented 6 days ago

Probably need to use the existing Application.mk with all ABI and platform an old Android.