Rg.Plugins.Popup
Rg.Plugins.Popup copied to clipboard
Error: : XamlC error XFC0000 : Cannot resolve type "PopupPage" when using xmlns:rg="http://rotorgames.com"
🐛 Bug Report
Getting the exception in the error window for each created view "Error: : XamlC error XFC0000 : Cannot resolve type "PopupPage""
Due to this reason application is not running from the app launcher. It keeps crashing.
Note: If the app connected to debugging mode then there is no issue.
Expected behavior
The app should not crash in any mode
Reproduction steps
- Install Xamarin.Forms latest stable library i.e. 4.8.0.1687
- Install Rg.Plugins.Popup i.e. 2.0.0 and above
Version: 2.0.0.9
Platform:
- [x] :iphone: iOS 14.2
- [x] :robot: Android 10
- [ ] :checkered_flag: WPF
- [ ] :earth_americas: UWP
- [ ] :apple: MacOS
- [ ] :tv: tvOS
- [x] :monkey: Xamarin.Forms
Any update on this issue?
Here is one sample project which I have created to reproduce this issue. Seems like this issue is coming because of the latest stable release i.e. Xamarin.Forms 4.8.0.1687
@shweta1915 thank you for the demo, I have provided a 'fixed' example Here
this is indeed unusual, it does seem that Xamarin.Forms 4.8.0.1687 is causing some issue.
I also noticed that if you convert the popup pages to use the older
xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
instead of the newer 'xmlns:rg="http://rotorgames.com"'
The issue seems to go away
@dansiegel do you have any idea why this would be so? Would the latest Xamarin.Forms somehow be interfering with your xmlns definition? any use of http://rotorgames.com
results in the XamlC error
@LuckyDucko Thank you for the solution, it worked
This solution is temporally since you always have to do it by hand. I am using xamarin 5 and having same issue.
@valentasm1 ill reopen and change the title of the bug to better reflect the bug thats happening here
this error does not let me work with the hot reload
I was able to fix the XamlC error and hot reload problem by:
- importing the Rg.Plugins.Popup .csproj and referencing the project and its dll's
- putting the namespace ref's back to:
xmlns:rg="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
xmlns:rga="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
@tkefauver it's made me crazy for days, can you share it as a small sample code please?
Try this
<?xml version="1.0" encoding="utf-8" ?>
<pages:PopupPage
x:Class="Worker.Mobile.Views.Modals.GoogleMapsPinClickPopUpPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
xmlns:controls="clr-namespace:Worker.Mobile.Views.Controls;assembly=Worker.Mobile"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:modals="clr-namespace:Worker.Mobile.ViewModels.Modals;assembly=Worker.Mobile"
xmlns:models="clr-namespace:Worker.Mobile.Models;assembly=Worker.Mobile"
xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
xmlns:translations="clr-namespace:Worker.Mobile.Services.Translations;assembly=Worker.Mobile"
x:DataType="modals:GoogleMapsPinClickPopUpViewModel"
mc:Ignorable="d">
<pages:PopupPage.Animation>
<animations:ScaleAnimation
DurationIn="400"
DurationOut="300"
EasingIn="SinOut"
EasingOut="SinIn"
HasBackgroundAnimation="True"
PositionIn="Center"
PositionOut="Center"
ScaleIn="1.2"
ScaleOut="0.8" />
</pages:PopupPage.Animation>
<!-- You can use any elements here which are extended from Xamarin.Forms.View -->
<Frame
Margin="20,0,20,0"
Padding="30"
BackgroundColor="{StaticResource ColorWhite}"
CornerRadius="30"
HorizontalOptions="Center"
VerticalOptions="Center">
<StackLayout>
<Label
FontFamily="{StaticResource MuliSemiBold}"
FontSize="Large"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Style="{StaticResource DefaultLabelStyle}"
Text="{Binding Title}"
TextColor="{StaticResource ColorBlack}" />
<Grid
Margin="0,15,0,0"
ColumnDefinitions="*,*"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
<Button
Grid.Column="0"
Command="{Binding CloseCommand}"
Style="{StaticResource ButtonWhiteBlackCorners}"
Text="{translations:Translator Key={x:Static models:M.GenericNo}}" />
<Button
Grid.Column="1"
Command="{Binding OkCommand}"
Style="{StaticResource ButtonBlack}"
Text="{translations:Translator Key={x:Static models:M.GenericYes}}" />
</Grid>
</StackLayout>
</Frame>
</pages:PopupPage>
It wasn't about the popup page, It resolved when I add the xmlns to the App.xaml.
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/custom-namespace-schemas#consuming-a-custom-namespace-schema
I am using Prism with DryIoc (and not unity). Following a suggestion from another thread I replaced
xmlns:prism="http://prismlibrary.com"
with
xmlns:prism="clr-namespace:Prism.DryIoc;assembly=Prism.DryIoc.Forms"
in my App.xaml file and the error disappeared.
I had the same error with PopupPage from Rg.Plugins.Popup, so I also replaced
xmlns:pages="http://rotorgames.com"
with
xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
and that error disappeared as well.
As these are two different libraries, acting similarly, it might be a general VS issue. But could also be the same error in two libraries.
The link from @ysmoradi says that using a custom namespace requires a direct reference to the assembly through C# code in order for VS to find it and not show this error. I haven't tried it but that might also be a possible solution.
Quote - .."this is indeed unusual, it does seem that Xamarin.Forms 4.8.0.1687 is causing some issue."...
We are up to version 5.0.0.2515 of Xamarin.Forms.
Are you planning to resolve this issue as we cannot keep using alternative code and "tricks" to work around this surely ?
@Krammig the alternative code is actually I believe the original code that was within Rg.
I no longer maintain Rg as I have been putting my limited time into Mopups, however its interesting that Prism has this issue as well, as @dansiegel was the one who originally introduced the xmlns:pages="http://rotorgames.com"
addition to the repo.
I have always relied on using the older version of xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"