Skip to content

Missing Method Exception in Start method for UWP (Xamarin Forms) #390

Closed

Description

I added the mobile centre SDK to my xamarin forms app and then added the below in App.xaml.cs:
MobileCenter.Start("ios=eab5ae24-2c21-4bc4-af8b-bdc01b41d27d;" +
"uwp=08df195d-1f0d-42db-bf5c-70de451d9e3a" +
"android=fab0066e-af9a-494f-b677-b231cfec53b9",
typeof(Analytics), typeof(Crashes));

It works well in iOS and Andriod but results in the below error in UWP:

System.MissingMethodException occurred
HResult=0x80131513
Message=Method not found: 'System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken Windows.ApplicationModel.Core.CoreApplication.add_LeavingBackground(System.EventHandler`1<Windows.ApplicationModel.LeavingBackgroundEventArgs>)'.
Source=
StackTrace:
at Microsoft.Azure.Mobile.Utils.ApplicationLifecycleHelper..ctor()
at Microsoft.Azure.Mobile.Utils.ApplicationLifecycleHelper.get_Instance()
at Microsoft.Azure.Mobile.MobileCenter.InstanceConfigure(String appSecretOrSecrets)
at Microsoft.Azure.Mobile.MobileCenter.StartInstanceAndConfigure(String appSecret, Type[] services)
at Microsoft.Azure.Mobile.MobileCenter.PlatformStart(String appSecret, Type[] services)
at Microsoft.Azure.Mobile.MobileCenter.Start(String appSecret, Type[] services)
at TILL.POS.App.OnStart() in C:\Source\Till-POS\2.Clients\TILL.POS\App.xaml.cs:line 199
at Xamarin.Forms.Platform.UWP.WindowsBasePage.LoadApplication(Application application)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions