Could not resolve reference only in Release Build

I'm trying to include a 3rd party component, Localytics SDK, in my Android project. It works fine for debug builds, however when I switch to release build, it generates a build error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task LinkAssemblies: error XA2006: Could not resolve reference to 'Android.Gms.Gcm.Iid.InstanceIDListenerService' (defined in assembly 'LocalyticsXamarin.Android, Version=, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.GooglePlayServices.Gcm, Version=, Culture=neutral, PublicKeyToken=null'. When the scope is different from the defining assembly, it usually means that the type is forwarded. (

Here is the strange part... If I change the "Linker Behavior" to "Don't Link", it builds fine, however the apk is too large so this isn't an option for us. If I change it back to "Link SDK assemblies only" and set "Ignore assemblies" to "Android.Gms.Gcm;Xamarin.GooglePlayServices.Gcm;LocalyticsXamarin.Android", it gives the same error.

So it's related to linking, but if I ignore linking the assemblies in the error message, it still errors... Any idea what I'm missing?



Sign In or Register to comment.