-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvalidCastException when setting LicenseKey #19
Comments
Did you set the app name like it is described in https://www.mrgestures.com/#HowToConfigureAppName? The LicenseKey must be set after |
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? |
It still worked for others with XF 3.6. |
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 |
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. |
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. |
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. |
Sounds good! Thanks for your help on this 🚀 |
@harry-gordon could you actually describe the workarround? It happened I've got same type project: XF + MvvmCross. |
@agat366 It's described in MvvmCross/MvvmCross#2832 (comment) |
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.
The text was updated successfully, but these errors were encountered: