Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
devemux86 opened this issue May 18, 2024 · 11 comments
Open

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

devemux86 opened this issue May 18, 2024 · 11 comments

Comments

@devemux86
Copy link
Collaborator

devemux86 commented May 18, 2024

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

It probably needs to rebuild the native libraries for Android.

@devemux86 devemux86 changed the title Android 15: VTM does not run on 16-KB Android 15: VTM does not run on 16 KB page size May 19, 2024
@SammysHP
Copy link

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
Copy link
Collaborator Author

@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
Copy link

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 devemux86 changed the title Android 15: VTM does not run on 16 KB page size VTM does not run on Android 15 with 16 KB page size May 20, 2024
@devemux86
Copy link
Collaborator Author

devemux86 commented May 20, 2024

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

@ocsike
Copy link

ocsike commented Sep 20, 2024

Hi,
Can you tried to build JNI with gdx-jnigen 2.5.2 ?
libgdx/gdx-jnigen#73

@devemux86
Copy link
Collaborator Author

devemux86 commented Sep 20, 2024

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
Copy link

ocsike commented Sep 26, 2024

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
Copy link

ztNFny commented Nov 1, 2024

@ocsike could you provide those 16k libs?

@ocsike
Copy link

ocsike commented Nov 2, 2024

@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
Copy link
Collaborator Author

devemux86 commented Nov 3, 2024

@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
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants