Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
This problem might be a specific instance of something more general, but the following code illustrates the issue.
If this code is ran as is, the callback is never made, but if the commented out code that subscribes via the static call directly is made it works.
This problem does not occur when the same code is run on Android.
Curiously if the TArgs argument is a string it always works, but if it is an int or enum or other object it fails.
public class MessageTest
private const string MessageKey = "MessageKey";
private interface SubscriberInterface
void Subscribe<TSender, TArgs> (object subscriber, string message, Action<TSender, TArgs> callback, TSender source = null) where TSender : class;
private class SubscriberImplmentation : SubscriberInterface
public void Subscribe<TSender, TArgs> (object subscriber, string message, Action<TSender, TArgs> callback, TSender source = null) where TSender : class
public void Test ()
SubscriberInterface subscriber = new SubscriberImplmentation ();
ConsoleColor color = ConsoleColor.Black;
// The direct call to MessagingCenter sets up the sibscriber and a call back is received
/*Xamarin.Forms.MessagingCenter.Subscribe<object,ConsoleColor> (this, MessageKey,
(sender, argument) => System.Diagnostics.Debug.WriteLine ("["+argument+"]" + " was sent to me"));*/
// If the direct call to MessagingCenter is not made, the indirect call does not result in a callback, if both are called it does.
subscriber.Subscribe<object,ConsoleColor> (this, MessageKey,
(sender, argument) => System.Diagnostics.Debug.WriteLine ("["+argument+"]" + " was sent to me"));
System.Diagnostics.Debug.WriteLine ("Sending Message");
Xamarin.Forms.MessagingCenter.Send<object,ConsoleColor> (this, MessageKey, color);
Could you attach a complete test case ? Also, what xamarin.ios version are you using ?
Created attachment 12334 [details]
Project to illustrate problem
Version: 220.127.116.11 (Business Edition)
Build date: 2015-06-30 15:19:13-0400
I have checked this issue and observed that when I run the project with Indirect call and (Direct call + Indirect call ) in both case app not deployed on simulator.
However when I implement the same in android it works.
Please let me know if I missed anything to reproduce this issue.
=== Xamarin Studio ===
Version 5.9.4 (build 5)
Installation UUID: 3d25a767-a003-4a7d-9f5e-e57987cf6cf0
Mono 4.0.2 ((detached/c99aa0c)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400020005
=== Xamarin.Android ===
Version: 18.104.22.168 (Enterprise Edition)
Android SDK: /Users/mac360_xamarin/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
=== Xamarin Android Player ===
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
=== Apple Developer Tools ===
Xcode 6.3 (7569)
=== Xamarin.iOS ===
Version: 22.214.171.124 (Enterprise Edition)
Build date: 2015-06-30 15:19:13-0400
=== Xamarin.Mac ===
Version: 126.96.36.199 (Enterprise Edition)
=== Build Information ===
Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8
=== Operating System ===
Mac OS X 10.10.4
Darwin mac360-xamarins-Mac-mini.local 14.4.0 Darwin Kernel Version 14.4.0
Thu May 28 11:35:04 PDT 2015
Sorry I neglected to say that this problem occurs on iOS devices not simulators.
If I run this on an iPad 2 running 8.3 I see the problem, on a simulator it calls back as expected.
I have checked this issue again and observed the same behaviour as simulator.
Could you please provide us reproduction steps, iOS Device logs and IDE logs.So that we can reproduce at our end.
iOS Device Logs: XS ->View ->Pads->iOS Device Logs.
IDE logs: XS ->Help ->Open Log Directory.
Created attachment 12363 [details]
Log files when application runs and fails on a real device
The iOS device log is from a run that fails, the video shows the application succeeding on a simulator and then failing on a real device.
Thanks so much for taking the time to submit this report! I attempted to reproduce this issue based on the bug description with the latest Xamarin.iOS 10.12.0.14, and I was unable to hit the problem. If this issue is still occurring for you, please reopen this report and attach a project that reproduces the issue, ideally starting with a new template project and then adding just the code necessary to demonstrate the issue.