Thanks to visit codestin.com
Credit goes to github.com

Skip to content

.NET 9 Project won't start on Android with 16kb page size enabled #9829

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

Open
phillippschmedt opened this issue Feb 24, 2025 · 4 comments
Open
Assignees
Labels
Area: App Runtime Issues in `libmonodroid.so`.

Comments

@phillippschmedt
Copy link

phillippschmedt commented Feb 24, 2025

Description

When creating a fresh .NET 9 MAUI project and trying to deploy it on an android 15 device with 16kb page size enabled the app won't start. Problem happens on emulator and real device.

Steps to Reproduce

  1. Create an android 16kb emulator as described here: https://developer.android.com/guide/practices/page-sizes#16kb-emulator
  2. Create a new .NET 9 MAUI project
  3. Try to start on the emulator

Link to public reproduction project repository

https://github.com/phillippschmedt/Android16KBProblems

Version with bug

9.0.40 SR4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

Android 15 16Kb enabled emulator or real device with 16kb enabled (pixel 8a, pixel 8)

Did you find any workaround?

No

Relevant log output

@jfversluis jfversluis transferred this issue from dotnet/maui Feb 24, 2025
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Feb 24, 2025
@jpobst jpobst added Area: App Runtime Issues in `libmonodroid.so`. and removed needs-triage Issues that need to be assigned. t/bug labels Feb 24, 2025
@borrrden
Copy link

borrrden commented Mar 24, 2025

I'm curious about this as well. Is there some way to signal using 16k page aligned libraries? I find the following in my APK to be unaligned (all of the AOT ones are aligned, but these are prebuilt before the app by Microsoft, I believe) when compiling for .NET 8 via .NET 9.0.200

  • libSystem.Security.Cryptography.Native.Android.so
  • libmonodroid.so
  • libmono-component-marshal-ilgen.so
  • libmonosgen-2.0.so
  • libSystem.IO.Compression.Native.so
  • libSystem.Native.so

I do indeed so that at least Microsoft.NETCore.App.Runtime.Mono.android-arm64/8.0.13/runtimes/android-arm64/native/libmonosgen-2.0.so is not properly aligned but 9.0.2 is so that might be a clue. Does this require actually TARGETING .NET 9 (net9.0-android) or is it enough to build with the .NET 9 tooling?

@amirvenus
Copy link

Are you sure this is a Maui bug?

Would you be able to reproduce with a plain .net for Android app (NOT Maui)?

@phillippschmedt
Copy link
Author

@amirvenus I am only using .NET MAUI. I can't talk about anything else, sorry.

@borrrden
Copy link

borrrden commented Apr 8, 2025

I would bet this is not MAUI specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App Runtime Issues in `libmonodroid.so`.
Projects
None yet
Development

No branches or pull requests

5 participants