Reputation: 1676
I updated one of my sample Xamarin Forms applications to the new Universal API and Xamarin.Forms 1.3.0.6286-pre4.
The main parts of the two projects:
//App.cs in XamlMaps (the PCL part)
namespace XamlMap
{
public class App : Application
{
public App ()
{
MainPage = new MainPage(); //Main page is a Xaml which holds a Label
}
protected override void OnResume()
{
Debug.WriteLine("OnResume");
base.OnResume();
}
protected override void OnSleep()
{
Debug.WriteLine("OnSleep");
base.OnSleep();
}
protected override void OnStart()
{
Debug.WriteLine("OnStart");
base.OnStart();
}
}
}
//AppDelegate.cs in XamlMaps.iOS
namespace XamlMap.iOS
{
[Register ("AppDelegate")]
public partial class AppDelegate : FormsApplicationDelegate
{
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
Forms.Init();
LoadApplication (new App ());
return base.FinishedLaunching (app, options);
}
}
}
I removed all other dependencies except for Xamarin.Forms.
I am still receving the following error when I am trying to build for the device:
Error MT2002: Failed to resolve "System.Void UIKit.UICollectionView::set_DataSource(UIKit.UICollectionViewDataSource)" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065" (MT2002) (XamlPlayer.iOS)
When I run my projects on the simulator everything works just fine: the apps come up and everything works as before.
Any idea why Mtouch is failing on this one?
Upvotes: 2
Views: 1539
Reputation: 414
If you don't have a native libraries, you can set Options->iOS Build->Link behavior to Din't link.
Upvotes: 1
Reputation: 76
The MT2002 error occurs because some symbol does not exists in the mscorlib.dll assembly. >Some code from your application (or 3rd party assemblies) is using this (missing) API and >needs to be removed/recompiled.
Try to set the linker to link all assemblies, last time I had the same problem with splat and it worked.
Upvotes: 0
Reputation: 43553
Xamarin.Forms 1.3.0 was based on a preview version of the unified API. There's been several previews since Xamarin.iOS 7.4 was released (last summer) and, as previews, there were some incompatible changes between the versions (that requires you to recompile any references).
The final/stable unified API that ships with Xamarin.iOS 8.6 has a few differences with the previews. You'll need an updated version of Xamarin.Forms (1.3.1 iirc) that was built against the final API.
Upvotes: 2