Search code examples
xamarin.iosxamarinmvvmcross

iOS Project Fails to Compile


When compiling iOS project developed with MvvmCross version 3.5.0, I get the following error:

Failed to resolve "Foundation.NSDate Foundation.NSDate::op_Explicit(System.DateTime)" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065"


Solution

  • The bug is in the method:

    public void Include(UIDatePicker date) in LinkerPleaseInclude class. Trying to pass DateTime as NSDate.

    Just comment out or remove following code :

    public void Include(UIDatePicker date)
    {
        date.Date = date.Date.AddSeconds(1);
        date.ValueChanged += (sender, args) => { date.Date=NSDate.DistantFuture; };
    }
    

    Also can be resolved by updating binary libraries to unified api.

    You can get detailed information on

    http://developer.xamarin.com/guides/cross-platform/macios/unified/