I've been seeing this problem popping up in the forum: old projects built under the classic iOS packages work in the simulator, but fail to build for an actual device. Here is the error:
/iOS/MTOUCHTASK: Error MT2002: Failed to resolve "Xamarin.Forms.BindableProperty Xamarin.Forms.BindableProperty::Create(System.Linq.Expressions.Expression1<System.Func
2<!!0,!!1>>,!!1,Xamarin.Forms.BindingMode,Xamarin.Forms.BindableProperty/ValidateValueDelegate1<!!1>,Xamarin.Forms.BindableProperty/BindingPropertyChangedDelegate
1<!!1>,Xamarin.Forms.BindableProperty/BindingPropertyChangingDelegate1<!!1>,Xamarin.Forms.BindableProperty/CoerceValueDelegate
1<!!1>)" reference from "Xamarin.Forms.Core, Version=1.2.3.0, Culture=neutral, PublicKeyToken=null" (MT2002) (Extracon.Survey.iOS)
Changing the linking to "Link All Assemblies"builds OK, but the you don't get touch events firing, so not a real solution.
I built using the -v -v -v -v option, with the attached log file. I believe that the problem (as pointed out in other posts) is that an old version of Xamarin.Forms is being linked based upon this log error (See "Xamarin.Forms.Core, Version=1.2.3.0, Culture=neutral, PublicKeyToken=null"):
MTOUCHTASK: error MT2002: Failed to resolve "Xamarin.Forms.BindableProperty Xamarin.Forms.BindableProperty::Create(System.Linq.Expressions.Expression1<System.Func
2<!!0,!!1>>,!!1,Xamarin.Forms.BindingMode,Xamarin.Forms.BindableProperty/ValidateValueDelegate1<!!1>,Xamarin.Forms.BindableProperty/BindingPropertyChangedDelegate
1<!!1>,Xamarin.Forms.BindableProperty/BindingPropertyChangingDelegate1<!!1>,Xamarin.Forms.BindableProperty/CoerceValueDelegate
1<!!1>)" reference from "Xamarin.Forms.Core, Version=1.2.3.0, Culture=neutral, PublicKeyToken=null"
--- inner exception
Mono.Cecil.ResolutionException: Failed to resolve Xamarin.Forms.BindableProperty Xamarin.Forms.BindableProperty::Create(System.Linq.Expressions.Expression1<System.Func
2<!!0,!!1>>,!!1,Xamarin.Forms.BindingMode,Xamarin.Forms.BindableProperty/ValidateValueDelegate1<!!1>,Xamarin.Forms.BindableProperty/BindingPropertyChangedDelegate
1<!!1>,Xamarin.Forms.BindableProperty/BindingPropertyChangingDelegate1<!!1>,Xamarin.Forms.BindableProperty/CoerceValueDelegate
1<!!1>)
at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in :0
at Xamarin.Linker.Steps.MobileMarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in :0
at MonoTouch.Tuner.MonoTouchMarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in :0
at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in :0
at Xamarin.Linker.Steps.CoreMarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in :0
at MonoTouch.Tuner.MonoTouchMarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in :0
at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in :0
at MonoTouch.Tuner.MonoTouchMarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in :0
at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in :0
at Xamarin.Linker.Steps.CoreMarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in :0
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in :0
at Mono.Linker.Steps.MarkStep.Process () [0x00000] in :0
at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in :0
at Xamarin.Linker.Steps.MobileMarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in :0
at Xamarin.Linker.Steps.CoreMarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in :0
at MonoTouch.Tuner.MonoTouchMarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in :0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in :0
at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List1& assemblies) [0x00000] in <filename unknown>:0
---
at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List
1& assemblies) [0x00000] in :0
at MonoTouch.Target.LinkAssemblies (System.String main, System.Collections.Generic.List`1& assemblies, System.String output_dir, MonoTouch.Tuner.MonoTouchLinkContext& link_context) [0x00000] in :0
at MonoTouch.Target.ManagedLink () [0x00000] in :0
at MonoTouch.Target.ProcessAssemblies () [0x00000] in :0
at MonoTouch.Target.BuildApp () [0x00000] in :0
at MonoTouch.Application.BuildApp () [0x00000] in :0
at MonoTouch.Application.Build () [0x00000] in :0
at MTouch.Main2 (System.String[] args) [0x00000] in :0
at MTouch.Main (System.String[] args) [0x00000] in :0
Task "MTouchTask" execution -- FAILED
I have tried:
1) Cleaning All (Did not work)
2) Deleting and reinstalling Xamarin.Forms, Labs, whatever packages I think might might be outdated. iOS Xamarin.Forms is 1.4.2
Have NOT completely restarted the project b/c I have others and really don't want to screw up my repositories by restarting projects from scratch.
The must be a config file somewhere that is pointing the linker to the old Xamarin.Forms.Core - which are now gone - but I can't find where.
Any suggestions?
Shane