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

[FEATURE] <.NET9> contains a shared library 'libSkiaSharp.so' which is not correctly aligned. #3025

Open
1 task done
bcaceiro opened this issue Oct 1, 2024 · 5 comments

Comments

@bcaceiro
Copy link

bcaceiro commented Oct 1, 2024

Is your feature request related to a problem?

Building a .net MAUI project with Skia gives these warnings

NuGet package 'SkiaSharp.NativeAssets.Android' version '3.0.0-preview.3.1' contains a shared library 'libSkiaSharp.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details

Describe the solution you would like

Alignment issues solved for .net 9

Describe alternatives you have considered

It's not ab locking issue, since it can compile, just to leave this into consideration

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mattleibow
Copy link
Contributor

@jonathanpeppers any thoughts on what this means?

@jonathanpeppers
Copy link
Member

This is the upcoming 16kb alignment requirement for Google Play, and probably Android 16 / API 36 next year.

@grendello were you looking at this for SkiaSharp?

@grendello
Copy link
Member

@jonathanpeppers I tried to, but couldn't build it locally and then I got distracted by other tasks. I'll try to look into it soon.

@mattleibow
Copy link
Contributor

Is there some compiler/linker flag? If this is a Google requirement, then I am sure the latest skia code will have it somewhere and I could find it with a code search and backport.

@grendello
Copy link
Member

Is there some compiler/linker flag? If this is a Google requirement, then I am sure the latest skia code will have it somewhere and I could find it with a code search and backport.

If building with the NDK r28 (not yet released), the 16k alignment would be enabled automatically. With older NDK versions, one has to pass the -Wl,-z,max-page-size=16384 flag to the compiler when linking (or -z max-page-size=16384 when invoking the linker directly)

You can find more details here and here

NateMerritt added a commit to BiblioNexusStudio/bible-well that referenced this issue Nov 20, 2024
There are no HarfBuzzSharp or SkiaSharp packages available which correctly use 16 kb alignment.  It looks like they should release in the future, though.  Using them will be a requirement to publish to Google next year.  See:
* mono/SkiaSharp#3025
* dotnet/android#9075
NateMerritt added a commit to BiblioNexusStudio/bible-well that referenced this issue Nov 20, 2024
* Add basic GitHub Action workflows to build/test pre and post-merge.

* Switch to Windows image which comes with more workloads pre-installed.

See https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#workloads-components-and-extensions.  Ubuntu doesn't have the android workload installed by default.

* Remove Desktop and Browser targets to improve build times.

* Ignore XA0141 warning.

There are no HarfBuzzSharp or SkiaSharp packages available which correctly use 16 kb alignment.  It looks like they should release in the future, though.  Using them will be a requirement to publish to Google next year.  See:
* mono/SkiaSharp#3025
* dotnet/android#9075

* Ensure necessary .net workloads are present during build.

* Create Release-Optimized build configuration for post-merge.

Use Release for PR pre-merge checks and Release-Optimized for post-merge deployment package builds.

* Attempt to reduce workload install time.
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