My Xamarin Forms app (for Android) in release mode have size 39 Mb. I enabled option "Link All Assemblies". I read about this option and I understand that this is difficult. But the big way starts with the first step. I have this exception:
10-30 20:25:18.895 I/MonoDroid(12805): UNHANDLED EXCEPTION:
Thread started: <Thread Pool> #9
10-30 20:25:19.023 I/MonoDroid(12805): System.NullReferenceException: Object reference not set to an instance of an object.
10-30 20:25:19.023 I/MonoDroid(12805): at Xamarin.Forms.Platform.Android.AppCompat.Platform.LayoutRootPage (Xamarin.Forms.Page page, System.Int32 width, System.Int32 height) [0x00034] in <375f0348c53348fdb7c0a424087b45cb>:0
10-30 20:25:19.023 I/MonoDroid(12805): at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0000a] in <375f0348c53348fdb7c0a424087b45cb>:0
10-30 20:25:19.023 I/MonoDroid(12805): at Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00018] in <375f0348c53348fdb7c0a424087b45cb>:0
10-30 20:25:19.023 I/MonoDroid(12805): at Android.Views.ViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00008] in <241e52499950417a9f098f3fc184c7de>:0
10-30 20:25:19.023 I/MonoDroid(12805): at (wrapper dynamic-method) System.Object:28e70870-796b-47c6-a7d7-29a2619bac5a (intptr,intptr,bool,int,int,int,int)
10-30 20:25:19.066 W/art (12805): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
I added this file(Build Action to LinkDescription) in my projects:
<linker>
<assembly fullname="Xamarin.Forms.Platform.Android">
<type fullname="Xamarin.Forms.Platform.Android.AppCompat.Platform.LayoutRootPage">
<method name=".ctor" />
</type>
</assembly>
</linker>
But I have same exception. I added this item in my csproj:
<PropertyGroup>
<AndroidLinkSkip>Xamarin.Android.Support.v7.AppCompat;Xamarin.Forms.Platform.Android</AndroidLinkSkip>
</PropertyGroup>
But I have same exception. Any ideas?