1
votes

I'm building a Xamarin Forms app for Android and iOS. So far I've been testing the iOS version on the provided simulators without issue.

When attempting to test on an iPhone 6S with the latest iOS updates, I get the following build error:

Can't resolve the reference 'System.Reflection.Emit.DynamicMethod', referenced from the method 'System.Func2<System.Object,System.Object> System.Web.Http.Metadata.Providers.AssociatedMetadataProvider1::CreateDynamicValueAccessor(System.Reflection.MethodInfo,System.Type,System.String)' in 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Any suggestions?

Thanks

1

1 Answers

1
votes

It is not supported for iOS to use System.Reflection.Emit as iOS prohibits dynamic code generation. It is a Xamarin limitation:

Reflection.Emit is about generating code dynamically and have that code JITed and compiled to native code. Due to the limitations on the iPhone (no JIT compilation) this is not supported.

It may be caused by some third-party lib, you could update it to the appropriate version to have a try, like Debugging linker errors.

Or you could add the lib to the xamarin.ios project to have a try, refer to xamarin build pass on simulator but fails on real device .