Hi,
I get an exception whenever the app tries to open a popup in a UWP application, there is no error in Android and iOS. The error only occurs when the application is packaged and installed from that package, there is no error when the application in started from Visual Studio using Release or Debug builds. I tried to update to the last version of the library, but the error is still there.
Te exception details are pasted below:
 | Name | Value | Type
-- | -- | -- | --
â–¶ | $exception | {System.InvalidCastException: Specified cast is not valid. at Rg.Plugins.Popup.WinPhone.Impl.PopupPlatformWinPhone.
Same with me.
I'm using version 1.1.4.154-pre and this issue only occurs in UWP Release when Compile with .NET Native tool chain option is checked in UWP project build properties (which is required to package UWP apps to Windows Store).
Hello,
I've got the exactly the same issue on 1.1.4-154-pre. Plugin does not want to work in Native tool chain compliation mode.
EDIT - it was my fault, I haven't regsitered properly plugin in Init method.
Hi, there is a way to solve this problem?
How it is the way to registry properly the plugin in Init method?
Thanks
After digging for a while in the source code, I found a solution to this:
The plugin initialization in _App.xaml.cs_ (in the UWP project) must be changed from
Rg.Plugins.Popup.Popup.Init();
Xamarin.Forms.Forms.Init(e);
to
Rg.Plugins.Popup.Popup.Init();
Xamarin.Forms.Forms.Init(e, Popup.GetExtraAssemblies());
See https://github.com/rotorgames/Rg.Plugins.Popup/wiki/Troubleshooting#uwp-troubleshooting
Most helpful comment
See https://github.com/rotorgames/Rg.Plugins.Popup/wiki/Troubleshooting#uwp-troubleshooting