Bug 37539 - You MUST call Xamarin.Insights.Initialize()
Summary: You MUST call Xamarin.Insights.Initialize()
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Dominic N [MSFT]
Depends on:
Reported: 2016-01-09 00:04 UTC by David
Modified: 2017-06-29 04:30 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 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:

Description David 2016-01-09 00:04:22 UTC
My released app on the Play store reports in the Crashes section the following many times:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
	... 1 more
Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.InvalidOperationException: You MUST call Xamarin.Insights.Initialize(); prior to using it.
  at Xamarin.InsightsCore.Device.get_PlatformServices () <0xb053d6f0 + 0x0004c> in <filename unknown>:0 
  at Xamarin.InsightsCore.Utilities.GetMillisecondsSinceEpoch () <0xb053d4e8 + 0x0000b> in <filename unknown>:0 
  at Xamarin.InsightsCore.Core..ctor () <0xb053d408 + 0x00053> in <filename unknown>:0 
  at Xamarin.InsightsCore.Device.get_Core () <0xb053d2c0 + 0x0008f> in <filename unknown>:0 
  at Xamarin.Insights.TrackTime (System.String identifier, IDictionary`2 table) <0xb053d188 + 0x00013> in <filename unknown>:0 

I cannot reproduce that reliably but it happens every now and then "out in the wild".

People in the forums keep having this problem: https://forums.xamarin.com/discussion/47414/exception-on-developer-console-you-must-call-xamarin-insights-initialize-prior-to-using-it