Setup [assembly: LinkerSafe] for binding projects #77
Support Libraries Version (eg: 23.3.0):
Does this change any of the generated binding API's?
Describe your contribution
I discovered there was some file size that could be spared from the
To get an idea on what this saves, I tested the default Xamarin.Forms
It appears this change saves ~3.6MB in APK file size in release mode
Here is the results of
Here is the results of the after APK with
Here is my
I discovered there was some file size that could be spared from the support library assemblies in release APKs by using the `Link all assemblies` option. Since most Xamarin users will have the `Link SDK only` option set, we can save most Xamarin developers some APK size by setting up the `[assembly: LinkerSafe]` attribute in the support libraries. To get an idea on what this saves, I tested the default Xamarin.Forms template in VS for Mac. I then upgraded to `TargetFrameworkVersion` 8.0, API 26, Xamarin.Forms 2.5.0, and 22.214.171.124 support libraries. Before: - Support libs: 5231104 - APK: 20948533 After `[assembly: LinkerSafe]`: - 2357248 - 17312534 It appears this change saves ~3.6MB in APK file size in release mode for the default Xamarin.Forms template.
See the original PR #77 by @jonathanpeppers Basically we can enable these assemblies to be linked when projects are set to Link SDK Assemblies only. This can always be opted out of by specifying `AndroidLinkSkip` in your .csproj’s: ``` <PropertyGroup> <AndroidLinkSkip>Xamarin.Android.Support.Compat;Xamarin.Android.Support.Compat.UI;...</AndroidLinkSkip> </PropertyGroup> ```