Bug 58103 - Using MobileCenter support in App causes strange exception
Summary: Using MobileCenter support in App causes strange exception
Alias: None
Product: Live Player
Classification: Xamarin
Component: Mobile App ()
Version: 1.0.253
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-07-12 09:58 UTC by Martin Jørgensen
Modified: 2017-12-14 23:01 UTC (History)
2 users (show)

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 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:

Description Martin Jørgensen 2017-07-12 09:58:13 UTC
Using MobileCenter features in Xamarin Live causes strange exception:

On Android V1.0.439
"Uncaught Exception":
not a widening conversion
Parameter name: value (ArgumentException)

On iOS V1.0.402
"Uncaught Exception":
Object of type 'NInterpret.InterpretedObject' doesn't match target type 'Foundation.NSObject' (TargetException)

Code to reproduce:

public partial class App : Application
  public App ()

    MainPage = new TestApp.MainPage();

  protected override void OnStart ()
    // Handle when your app starts
    MobileCenter.Start("ios=...;" +
                       "android=...;" +
                       typeof(Analytics), typeof(Crashes), typeof(Distribute));

Comment 1 James Montemagno [MSFT] 2017-07-31 18:38:27 UTC
Workaround is to do some conditional compilation to not start if in the live player mode. We are working with the mobile center team on this, but that is my current recommendation.
Comment 2 ravenrgg 2017-11-22 18:32:48 UTC
I am seeing the same error on the Chapter 13 ImageBrowser example in Creating Mobile Apps using Android.  There is no code in the OnStart method.
Comment 3 James Montemagno [MSFT] 2017-11-27 19:30:23 UTC
Same with App Center just for reference
Comment 4 ravenrgg 2017-11-27 21:25:48 UTC
Can you elaborate on the Chapter 13 ImageBrowser question?  There is no code in the OnStart method.