Bug 23672 - MonoTouch has incorrect signature for "application:didUpdateUserActivity:"
Summary: MonoTouch has incorrect signature for "application:didUpdateUserActivity:"
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: XI 8.2.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2014-10-07 16:34 UTC by Justin Manus
Modified: 2014-11-26 12:12 UTC (History)
9 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:
VERIFIED FIXED

Description Justin Manus 2014-10-07 16:34:18 UTC
I'm using ReactiveUI, which subclasses all of the virtual methods in UIApplicationDelegate. When I run my application, I get the following error message (and the app does not run):

MonoTouch.RuntimeException: The registrar found a signature mismatch in the method 'MonoTouch.UIKit.Rx.UIApplicationDelegateRx.UserActivityUpdated' - the selector 'application:didUpdateUserActivity:' indicates the method takes 2 parameters, while the managed method has 1 parameters.

Looking in my monotouch.dll, I see that the export for this method is missing the UIApplication parameter:
[Export("application:didUpdateUserActivity:"), Availability(Introduced = Platform.iOS_8_0), CompilerGenerated]
public virtual void UserActivityUpdated(NSUserActivity userActivity) {
	throw new You_Should_Not_Call_base_In_This_Method();
}

I believe that it should be:
[Export("application:didUpdateUserActivity:"), Availability(Introduced = Platform.iOS_8_0), CompilerGenerated]
public virtual void UserActivityUpdated(UIApplication application, NSUserActivity userActivity) {
	throw new You_Should_Not_Call_base_In_This_Method();
}
Comment 1 Ram Chandra 2014-10-08 05:22:04 UTC
I have checked this issue and I am able to reproduce this issue.

I have checked the definition of "UserActivityUpdated" method in "UIApplicationDelegate" class and observed that "UserActivityUpdated" is having only one parameter i.e. "NSUserActivity".

I have also checked the definition of "UserActivityUpdated" method in apple doc which says that 
this method takes two parameter i.e. 

1. application :  The shared app object.
2. userActivity : The activity object containing the data associated with the task the user was performing.

Apple doc:
https://developer.apple.com/library/ios/documentation/uikit/reference/uiapplicationdelegate_protocol/index.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:didUpdateUserActivity:

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

Environment Info: 

=== Xamarin Studio ===
Version 5.5 (build 227)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.10.0 ((detached/633e444)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000020

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.0 (Business 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)
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)

=== Xamarin.iOS ===

Version: 8.2.0.196 (Business Edition)
Hash: c6bcfc8
Branch: 
Build date: 2014-10-05 21:42:57-0400

=== Build Information ===

Release ID: 505000227
Git revision: 7b721eeec7a2fa4c4f4de0ecd2aed4dc25edac95
Build date: 2014-10-02 15:53:38-04
Xamarin addins: 99ed56b428b31eba1efaace4d82188d6f334e6ca

=== Operating System ===

Mac OS X 10.9.5
Darwin Jatin66s-iMac.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 Sebastien Pouliot 2014-10-10 11:23:20 UTC
Yes, this is indeed a bug in our bindings.

As an immediate workaround you might want to try the "old" registrar while building your application as it does not do as much validations as the newer one.
Comment 3 Sebastien Pouliot 2014-10-10 12:06:25 UTC
Fixed in master / 13a27881585c66339a213a08354dbd872d1e3aba
Comment 4 Geoffrey Huntley 2014-11-09 16:50:12 UTC
@spouliot - ran into this one today. Any indication when this fix is going to be shipped?
Comment 5 Todd Berman 2014-11-10 19:17:40 UTC
Also ran into this today as well. Any ETA on it hitting beta/stable/alpha/anything?
Comment 6 Miguel de Icaza [MSFT] 2014-11-10 21:20:04 UTC
Another workaround is to change Rx to not override that method, and instead do this:

[Export("application:didUpdateUserActivity:")]
public virtual void UserActivityUpdated(NSUserActivity userActivity, NSUserActivity userActivity);

Instead of:

public override void UserActivityUpdated(NSUserActivity userActivity)
Comment 7 Todd Berman 2014-11-10 22:45:50 UTC
The Rx stuff is autogenerated.
Comment 8 Sebastien Pouliot 2014-11-11 08:28:15 UTC
Pending any surprises by Apple (like an iOS 8.2) this fix will be part of the next major (8.6) release, which should be in alpha/beta by the end of the month.
Comment 9 Sunil Kumar 2014-11-26 12:12:37 UTC
I have checked this issue and now it's working fine.

I have checked the definition of "UserActivityUpdated" method in "UIApplicationDelegate" class and observed that "UserActivityUpdated" method have two parameters  i.e. " UIApplication" and "NSUserActivity" as mentioned in apple doc.

Screencast: http://screencast.com/t/Q07fNvilk

Environment info:
=== Xamarin Studio ===

Version 5.7 (build 596)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.12.0 ((detached/b75fa2b)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000046

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.0.5 (Business Edition)
Hash: 880cc21
Branch: 
Build date: 2014-11-25 12:12:17-0500

=== Xamarin.Android ===

Version: 5.0.0.0 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		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)

=== Xamarin.Mac ===

Version: 1.11.1.201 (Business Edition)

=== Build Information ===

Release ID: 507000596
Git revision: d996e9ba6874a0d64241e43e5e6b06322ce29c84
Build date: 2014-11-25 17:17:54-05
Xamarin addins: 8ca19707b41536a391f53364ee4ff9272711feb0

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64