Bug 29903

Summary: AndroidLinkSkip not working
Product: Android Reporter: pragma.mobilexp
Component: MSBuildAssignee: Radek Doulik <radek.doulik>
Severity: normal CC: adam, brendan.zagaeski, mono-bugs+monodroid
Priority: Normal    
Version: 5.1   
Target Milestone: 6.0 (C6)   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description pragma.mobilexp 2015-05-09 13:06:29 UTC
Seems like the AndroidLinkSkip feature is not working.  I'm trying to prevent an assembly from being linked to work around bug 29900 in the platform.  However, the assembly is still linked which results in me having to turn off linking for all assemblies to get a Release build out.  Our apk unfortunately goes from 18MB to 43MB which is unacceptable.  Other users seem to [have reported](http://forums.xamarin.com/discussion/16279/android-skip-linking-broken-in-4-12-03003) the issue as well.
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2015-05-09 16:35:49 UTC
Thanks for the report.

If you have "Project Properties -> Android Options -> Linker [tab] -> Linking" set to "Sdk Assemblies Only", then the _application assembly_ isn't being _modified_ by the linker anyway.

The problem with Bug 29900 is that the linker is _reflecting_ on the application assembly to determine which types are safe to link out of the _other_ (SDK) assemblies. So unfortunately, if the linker is enabled _at all_ then you will hit Bug 29900, regardless of how many assemblies you skip using the `AndroidLinkSkip` property.

In short, I believe this bug can be marked RESOLVED ANSWERED (or similar).
Comment 2 Radek Doulik 2015-06-02 10:28:08 UTC
Yes, that's right. Even when the assembly is marked to be skipped, it needs to be loaded. Fortunately the bug #29900 is already fixed.
Comment 3 Adam Greene 2015-08-05 10:35:43 UTC
I'm still seeing this behaviour with Xamarin.Android and Xamarin 3.11.666.0.
Comment 4 Adam Greene 2015-08-05 10:52:30 UTC
After further research, the problem I'm seeing is that XamarinVS and Xamarin Studio maintain different lists of skipped assemblies and the one that was in Visual Studio was the correct list but the one shown in Xamarin Studio was wrong (and the linker uses the XS version).  So I fixed the list in Xamarin Studio and now it links correctly.
Comment 5 Adam Greene 2015-08-05 10:55:59 UTC
To be honest, it might have been a bad merge...