Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upInvalidCastException when setting LicenseKey #19
Comments
This comment has been minimized.
This comment has been minimized.
Did you set the app name like it is described in https://www.mrgestures.com/#HowToConfigureAppName? The LicenseKey must be set after |
This comment has been minimized.
This comment has been minimized.
Thanks for the quick reply Michael. I double checked, we are setting the name as required. I had a look at I wonder if this is a recent change in Xamarin Forms? |
This comment has been minimized.
This comment has been minimized.
It still worked for others with XF 3.6. |
This comment has been minimized.
This comment has been minimized.
I made a repo to demonstrate here: https://github.com/harry-gordon/mvvm-cross-mr-gestures It's based on an MvvmCross template I found so the main activity is called |
This comment has been minimized.
This comment has been minimized.
Any thoughts on this @MichaelRumpler? I thought it might be fixed in a later version of MvvmCross (after reading this MvvmCross/MvvmCross#2832) but I get the same result in 6.3.1. |
This comment has been minimized.
This comment has been minimized.
OK, I've got a work-around on my end, it's an issue with MvvmCross not being able to retrieve the current activity when it initializes Xamarin Forms so instead sets the context to the application. I've found a way to override that logic and pass in the correct activity, I'll raise this with MvvmCross as I doubt this is desired behavior. |
This comment has been minimized.
This comment has been minimized.
They closed the issue you linked because the workaround seemed to work, not because they fixed the bug - not what I would expect. I couldn't find a reliable way to read the app name without the Xamarin.Forms.Forms.Context. I'll add two more ways to get the app name to the next version. Maybe this will at least help some people. |
This comment has been minimized.
This comment has been minimized.
Sounds good! Thanks for your help on this |
This comment has been minimized.
This comment has been minimized.
@harry-gordon could you actually describe the workarround? It happened I've got same type project: XF + MvvmCross. |
This comment has been minimized.
This comment has been minimized.
@agat366 It's described in MvvmCross/MvvmCross#2832 (comment) |
This comment has been minimized.
This comment has been minimized.
Version 2.1.1 is now available on NuGet. |
I'm trying to get started with MR.Gestures in our Xamarin.Forms/MvvmCross project but I'm getting an exception from inside MR.Gestures when trying to set the licence key in MainActivity as per the Getting Started instructions:
The exception trace:
I've tried moving where we set the licence key around (including 1. finding a hook in MVVM Cross to set it between XF init and LoadApplication and 2. much later just before the component is needed) but I've had the same results.
Any help would be appreciated! Let me know if you have any questions.
For reference we are on XF version 3.6.0 and MvvmCross version 6.2.3.