From fb94c184345cb217cc419c912ba3f44254708344 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 17 Dec 2021 11:10:22 -0600 Subject: [PATCH] [android] don't include .so files in class libraries Fixes: https://github.com/xamarin/xamarin-android/issues/6545 If you do: 1. File -> New Xamarin.Android class library 2. Add `` You end up with 13MB `.dll` file with C# code inside! The class library is redistributing the SkiaSharp native libraries. `$(ShouldIncludeNativeSkiaSharp)` should default to `False` for class libraries. To test this change, I manually edited: %userprofile%\.nuget\packages\skiasharp\2.80.3\build\monoandroid1.0\SkiaSharp.targets %userprofile%\.nuget\packages\skiasharp\2.80.3\buildTransitive\monoandroid1.0\SkiaSharp.targets Now my class library is 76,800 bytes. When consuming this class library in an Android application project, everything should still work as expected. However, the application will need to reference SkiaSharp -- which is actually ideal. --- binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets index 7b870e572f4..1651e34a762 100644 --- a/binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets +++ b/binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets @@ -3,7 +3,8 @@ - True + True + False