1

I'm getting an error when trying to build app with Link SDK Assemblies Only(everything works on Don't Link)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata item 'System.Void Xamarin.Forms.Element::set_AutomationId(System.String)' (defined in 'ZXing.Net.Mobile.Forms, Version=2.1.47.0, Culture=neutral, PublicKeyToken=null') from 'ZXing.Net.Mobile.Forms, Version=2.1.47.0, Culture=neutral, PublicKeyToken=null' could not be resolved. (FleetApp.Droid)

I'm trying to add assemblies that cause the issue in ignore list:

enter image description here

But I can't get the error disappear. Is this correct way to do it? or am I adding wrong assemblies to ignore list?

P.S. Also tried adding them without braces.

Federico Navarrete
  • 3,069
  • 5
  • 41
  • 76
arsena
  • 1,935
  • 19
  • 36

1 Answers1

0

This is an issue of having an old version of Xamarin.Forms. You need to use the latest stable version of Xamarin.Forms as the dependency of ZXing.Net.Mobile.Forms does not strictly require you to have a version of Xamarin.Forms that doesn't include AutomationId.

Thus you would need >= Xamarin.Forms 2.2.0:

https://developer.xamarin.com/releases/xamarin-forms/xamarin-forms-2.2/2.2.0-stable/#AutomationId_Support

After you do that, you can remove all the Ignore Assemblies as you no longer would need to ignore assemblies.

Jon Douglas
  • 13,006
  • 4
  • 38
  • 51
  • I know that, but I have worse issues on new Xamarin.Forms: I get this: https://github.com/XLabs/Xamarin-Forms-Labs/issues/1125 and if I update XLabs to pre-release version than I get https://github.com/XLabs/Xamarin-Forms-Labs/issues/1231 this. and can't get that fixed. so old version of xamarin.forms was a workaround – arsena Dec 06 '16 at 18:44
  • I can understand that, but the answer to your original question is you need Xamarin.Forms 2.2.0 or greater. – Jon Douglas Dec 06 '16 at 19:03
  • I would highly advise that you work off the most recent stable versions of Forms, XLabs, and ZXing. It's too hard to depend on old versions. – Jon Douglas Dec 06 '16 at 19:04