Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: : XamlC error XFC0000 : Cannot resolve type "PopupPage" when using xmlns:rg="http://rotorgames.com" #619

Open
3 of 7 tasks
shweta1915 opened this issue Dec 11, 2020 · 14 comments

Comments

@shweta1915
Copy link

馃悰 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.

image

Expected behavior

The app should not crash in any mode

Reproduction steps

  1. Install Xamarin.Forms latest stable library i.e. 4.8.0.1687
  2. Install Rg.Plugins.Popup i.e. 2.0.0 and above

Version: 2.0.0.9

Platform:

  • 馃摫 iOS 14.2
  • 馃 Android 10
  • 馃弫 WPF
  • 馃寧 UWP
  • 馃崕 MacOS
  • 馃摵 tvOS
  • 馃悞 Xamarin.Forms
@shweta1915
Copy link
Author

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

Demo.zip

@LuckyDucko
Copy link
Collaborator

@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

@shweta1915
Copy link
Author

@LuckyDucko Thank you for the solution, it worked

@valentasm1
Copy link

This solution is temporally since you always have to do it by hand. I am using xamarin 5 and having same issue.

@LuckyDucko
Copy link
Collaborator

@valentasm1 ill reopen and change the title of the bug to better reflect the bug thats happening here

@LuckyDucko LuckyDucko reopened this Feb 14, 2021
@LuckyDucko LuckyDucko changed the title Error: : XamlC error XFC0000 : Cannot resolve type "PopupPage" Error: : XamlC error XFC0000 : Cannot resolve type "PopupPage" when using xmlns:rg="http://rotorgames.com" Feb 14, 2021
@rabileon
Copy link

rabileon commented Mar 5, 2021

this error does not let me work with the hot reload

@tkefauver
Copy link

tkefauver commented Aug 9, 2021

I was able to fix the XamlC error and hot reload problem by:

  1. importing the Rg.Plugins.Popup .csproj and referencing the project and its dll's
  2. 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"

@Erdogan34
Copy link

@tkefauver it's made me crazy for days, can you share it as a small sample code please?

@valentasm1
Copy link

valentasm1 commented Nov 5, 2021

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>

@Erdogan34
Copy link

It wasn't about the popup page, It resolved when I add the xmlns to the App.xaml.

@vppetrov
Copy link

vppetrov commented Feb 8, 2022

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.

@Krammig
Copy link

Krammig commented Oct 5, 2022

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 ?

@LuckyDucko
Copy link
Collaborator

@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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants