Bug 25693 - Error MT2002 Failed to resolve System.Void UIKit.UICollectionView set_DataSource
Summary: Error MT2002 Failed to resolve System.Void UIKit.UICollectionView set_DataSource
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.6.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-03 12:42 UTC by John Miller [MSFT]
Modified: 2015-01-14 09:56 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description John Miller [MSFT] 2015-01-03 12:42:05 UTC
**Overview:**

   MT2002 compiler error when trying to build a Forms 1.3.1-pre1 iOS app for device using the Unified API. 

**Steps to Reproduce:**

   Minimized, easy-to-follow steps that will trigger the bug. Include any special setup steps.

**Actual Results:**

>Error MT2002: Failed to resolve "System.Void UIKit.UICollectionView::set_DataSource(UIKit.IUICollectionViewDataSource)" >reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065" (MT2002)

**Expected Results:**

   No errors. There is no UICollectionView in the app project. 

**Build Date & Platform:**

   === Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: e01c3049-a2d2-4e0a-aad8-afe6fb627c4d
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/johnmiller/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: 8.4.0.47 (Business Edition)
Hash: 7244769
Branch: 
Build date: 2014-12-11 14:54:30-0500

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.10.0

**Additional Information:**

   I was also getting a similar error before with XI 8.6.0.44, but it was for uikit.uitableview::set_datasource.
Comment 1 Ram Chandra 2015-01-05 06:52:39 UTC
I have checked this issue and I am able to reproduce the reported behavior.

Steps I followed:

1. Create a Blank app (Xamarin.Forms Portable) project.
2. Migrate the iOS project to Unified API
3. Update the forms to "Forms 1.3.1-pre1"
4 Build the application for device.

When I build the Xamarin.Forms Unified API project on device I observed that I am getting following error: 

>MTOUCHTASK: error MT2002: Failed to resolve "System.Void UIKit.UICollectionView::set_DataSource(UIKit.IUICollectionViewDataSource)" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065"

I have also observed that there is no any UICollectionView exists on solution bu still I am getting above error for device only.

Screencast: http://www.screencast.com/t/ZqHtHhNmkOtF

Build error: https://gist.github.com/RamChBachkheti/2e3b7d6a3330dcdb8843

Additional Info: I am not getting this error with simulator. For simulator I am able to build and deploy application successfully.

Please let me know if I can provide more info to this issue.

Environment Info:

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Trial Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.4.0.47 (Trial Edition)
Hash: 7244769
Branch: 
Build date: 2014-12-11 14:54:30-0500

=== Xamarin.Mac ===

Version: 1.10.0.18 (Trial Edition)

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.10.0
Darwin Jatin66s-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 3 Sebastien Pouliot 2015-01-05 22:31:18 UTC
That's normal because of:

> Version: 8.4.0.47 (Business Edition)

XI 8.4 shipped with a _preview_ of the unified API, for example this means the protocolization (using interfaces for ObjC delegates) of the API was not complete.

AFAIK X.Forms 1.3.1 is built with the _final_ unified API, which means it requires XI 8.6.x.


WRT to comment #2 it's looks like an old MTD with a newer XI (8.6). However I can't be sure without seeing the complete signature (it's the parameter types that changed and that's not part of your comments).

The MTD that XI ships (with 8.4 or 8.6) was built against the unified preview (8.4) or final (8.6) API. IOW you need to use the version we shipped - or build your own using the version of XI you're using (there's no single binary that will work for unified for both 8.4 and 8.6).