You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, once assemblies are removed from the bundle additional changes have to be done in the native part of the runtime as it currently follows codepaths which assume assemblies are present in the bundle causing the app to crash during early startup. To be more specific:
Since NativeAOT generates native libraries and executables that do not
rely on assemblies they were compiled from, all managed assemblies can
be excluded from the application bundle.
This reduces the size of the application bundle by `3,17Mb` (or ~19%
compared to the baseline)
| MAUI ios app | Base | This PR | diff (%) |
|--------------|-----------|-----------|----------|
| SOD (Mb) | 50,13 | 41,93 | -16,3% |
| .ipa (Mb) | 16,59 | 13,43 | -19% |
Fixes: #18472
From: #17374 (comment):
I know this is still WIP but wanted to draw attention to one thing.
With the current setup the bundle still includes all the assemblies, which are not needed with NativeAOT.
As we do not use NativeAOT targets from https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets we have to manually exclude those files. For reference I achieved this with a custom target:
ivanpovazan@98a8f4e#diff-2e24f1b6f44df7580244d00f106fa1a9e2257536fbca9d7bbdc74571549324a9R1172-R1178
but there is probably a cleaner way of doing it.
Additionally, once assemblies are removed from the bundle additional changes have to be done in the native part of the runtime as it currently follows codepaths which assume assemblies are present in the bundle causing the app to crash during early startup. To be more specific:
xamarin_bridge_register_product_assembly
has to be guarded incoreclr-bridge.m
for example: ivanpovazan@98a8f4e#diff-6e15dd2bc3a656eafdaed8fc01cf1bc69efd7acd459e13680956adebf661366fR563-R567xamarin_open_and_register
of being called fromxamarin_main
:ivanpovazan@98a8f4e#diff-463ea10e390971f1d926d16f4dd9ed5bbfac4fd81d942b4f17eb0476d1c2d4e6R444-R467
The text was updated successfully, but these errors were encountered: