This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 43069 - [watchOS 2] WKInterfacePicker causing crashes when set to Sequence, containing more than 12 items, and ValueChange action outlet created
Summary: [watchOS 2] WKInterfacePicker causing crashes when set to Sequence, containin...
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS Designer (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: (C8)
Assignee: Vinicius Jarina
URL:
Depends on:
Blocks:
 
Reported: 2016-08-04 20:16 UTC by Gregory Gammon
Modified: 2016-09-08 13:32 UTC (History)
8 users (show)

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


Attachments
Crash Logs (72.49 KB, text/plain)
2016-08-04 20:16 UTC, Gregory Gammon
Details
Sample Project (4.23 MB, application/zip)
2016-08-05 17:52 UTC, Gregory Gammon
Details

Description Gregory Gammon 2016-08-04 20:16:08 UTC
Created attachment 16905 [details]
Crash Logs

I'm running into an issue developing an application with Xamarin + watchOS 2.

I've been able to reliably reproduce this on the watch simulator using a single interface containing a picker set to sequence mode. I have a list of 33 images that I am cycling through. The crash ONLY occurs when the ValueChanged action outlet is wired up through Interface Builder. If this action is not set, then the crash does not occur.
Comment 1 Rolf Bjarne Kvinge 2016-08-05 17:47:36 UTC
Could you please zip up and attach your project so that we can reproduce it ourselves?
Comment 2 Gregory Gammon 2016-08-05 17:52:37 UTC
Created attachment 16921 [details]
Sample Project

Attached is the sample project I used to reproduce this behavior.
Comment 3 Rolf Bjarne Kvinge 2016-08-05 19:08:06 UTC
I can reproduce the problem, which is that the generated code by the designer is incorrect.

The generated signature for the ValueChanged event is:

> partial void testPicker_ValueChanged (Foundation.NSObject value);

when it should be (according to Apple's documentation [1] the picker's action method format is "- (IBAction)pickerAction:(NSInteger)index")

> partial void testPicker_ValueChanged (nint value);

So I'm reassigning this to the designer team.

[1] https://developer.apple.com/library/watchos/documentation/WatchKit/Reference/WKInterfacePicker_class/
Comment 4 Rolf Bjarne Kvinge 2016-08-05 19:09:18 UTC
As a workaround you can replace the method signature in both the designer generated file and your implementation to the correct one (although you'll probably have to do it again in the designer generated file every time you edit the storyboard).
Comment 6 xamarin-release-manager 2016-09-02 16:02:10 UTC
Fixed in version 6.2.0.441 (master)

Author: Alan McGovern
Commit: 00f1d0694c08c33d2f6feeefa5a7453deea18360 (xamarin/md-addins)
Included in Commit: 772b2b9b1c7d8b2ebed5abe48688324aa7cbfa1a (mono/monodevelop)
Comment 7 Shruti 2016-09-07 07:58:04 UTC
Reproduce status:

I could successfully able to reproduce this issue using the builds:

XS 6.1.0. 5355

As on Running the project attached in this bug, when increase the time by scrolling the  mouse, it gives the exception.

Verification Status:

I have verified this issue with the latest master builds:

Xamarin Studio Enterprise
Version 6.2 (build 458)

Build Information
Release ID: 602000458
Git revision: fccbc03e59b31673d032a626c4f061c33ce96fc4
Build date: 2016-09-06 23:54:59-04
Xamarin addins: c66ba8e0dddcbaa087230af30082b7bfa5495c9d
Build lane: monodevelop-mdaddins-master

And have observed that the issue still exists, as on Running the project attached in this bug, when increase the time by scrolling the  mouse, it gives the exception.

Below is the screencast for the same:
http://www.screencast.com/t/lrWMb5Rzl

Below is the log w.r.t exception:
https://gist.github.com/Shruti360/f7082cd1ba3be6e0e919bae580d87001

Hence, reopening this issue.
Comment 8 Alan McGovern 2016-09-07 10:08:10 UTC
The attached project is known to be broken as the codegen was from a revision of XS which did not know this method had to be of type nint.

To test this you just have t drag/drop a new pickerview and double click it. Verify the parameter is now of type `nint`.

I did have to add one more patch to enable the 'double click to generate an eventhandler' feature for this widget so you will need a newer build.
Comment 9 xamarin-release-manager 2016-09-07 10:10:33 UTC
Fixed in version 6.1.0.5434 (cycle8)

Author: Alan McGovern
Commit: 7602d880f6ed42741107cbc3c2f07bb4d9a8b9ab (xamarin/md-addins)
Included in Commit: 2eac59d2a9b1b330759bd78bc8f2f42eb12f2b74 (mono/monodevelop)
Comment 10 Alan McGovern 2016-09-07 10:14:16 UTC
(The attached project can be made work again by triggering the codegen to run again and then fixing the build errors caused by the parameter changing. That is not necessary to verify the fix though.)
Comment 11 Shruti 2016-09-08 06:10:00 UTC
With the latest cycle 8 builds, i.e.

XS 6.1 (build 5436)

Build Information
Release ID: 601005436
Git revision: bc95b7878139d0971a3c55b5b9c4d604d9c6c6ec
Build date: 2016-09-07 16:44:19-04
Xamarin addins: bfc56f206c39fbf5929651ec42c98ab6aa5e8150
Build lane: monodevelop-lion-cycle8

I have checked this issue, and as per the comments #8 I have followed the following steps:

1. Opened the Designer, i.e. Interface.Storyboard file
2. Drag and Drop the picker in the interface controller
3. Double click on the Picker widget
4. Observed hat it entered the corresponding code in the InterfaceController.cs file and the Action in the InterfaceController.designer.cs file
5. We have observed that the parameter is now of type 'nint'
6. However, when run the project, it gives the exception.

Below is the screencast for the same:
http://www.screencast.com/t/qBh0TUl9

Application Output: https://gist.github.com/Shruti360/f33713019b2a1965a719dceeac469ec6
Diagnostic Report: https://gist.github.com/Shruti360/17671c3eb20195c570101b790d7b0db7
Environment Information: https://gist.github.com/Shruti360/a059c411f896b9ce8e0af1cdb8671b8e

Hence, reopening this issue.
Comment 13 Alan McGovern 2016-09-08 12:07:45 UTC
The issue you're seeing is not related to the designer code generation. Can you reset the watch sim and the iOS Sim and redeploy your application. That should fix the issue, whatever it is.

http://screencast.com/t/yW8LIunq
Comment 14 Shruti 2016-09-08 13:32:38 UTC
As per the comment #13 

We have reset the iOS simulator as well watch simulator. 

Moreover, edited the code as per the screencast, provided in the comment. 

This time applications launched successfully. And on scrolling the picker the exception does not appear.

Below is the build information we have used:

XS 6.1 (build 5436)

Build Information
Release ID: 601005436
Git revision: bc95b7878139d0971a3c55b5b9c4d604d9c6c6ec
Build date: 2016-09-07 16:44:19-04
Xamarin addins: bfc56f206c39fbf5929651ec42c98ab6aa5e8150
Build lane: monodevelop-lion-cycle8

Hence, marking this issue as verified fixed.

Note You need to log in before you can comment on or make changes to this bug.