Gorilla-Player-Support icon indicating copy to clipboard operation
Gorilla-Player-Support copied to clipboard

Root XAML element unrecognized, nothing to display

Open xufeipyxis opened this issue 6 years ago • 7 comments

Hi,

First of all, great job! Thanks!

But I have a very annoying issue now. I'm using MvvmCross and all its ContentPage is required to be MvxContentPage like this:

<?xml version="1.0" encoding="utf-8" ?>
<views:MvxContentPage x:TypeArguments="viewModels:DeviceScanViewModel"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:viewModels="clr-namespace:uProject.Core.ViewModels"
             xmlns:views="clr-namespace:MvvmCross.Forms.Views;assembly=MvvmCross.Forms">
    <ContentPage.Content>
        <StackLayout VerticalOptions="StartAndExpand">
            <Label Text="Welcome to Xamarin.Forms!"
                VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand" />
            <ListView ItemTemplate="{StaticResource ItemDataTemplateSelector}" ItemsSource="{Binding Devices}"
                      VerticalOptions="FillAndExpand">
                
            </ListView>
        </StackLayout>
    </ContentPage.Content>
</views:MvxContentPage>

But in this case, Gorilla refuses to display the page and the erros says:

Root XAML element unrecognized, nothing to display

To workaround this, I change views:MvxContentPage to ContentPage every time just to preview it in Gorilla and then change it back.

Any better workaround?

xufeipyxis avatar Jun 25 '18 07:06 xufeipyxis

I also have this error. Is Gorilla Player compatible with MvvmCross?

pablogupi avatar Sep 12 '18 10:09 pablogupi

cc: @pablogupi @xufeipyxis I'd say its any custom class or inheritance. I just ran into the same thing WITHOUT mvvcross, simply because my views are inherited from a ViewBase class, which is derived from ContentView.

Lack of inheritance support just killed this for me as being a replacement for LiveReload.

image

tlhintoq avatar Nov 05 '18 18:11 tlhintoq

You need to use Gorilla SDK to preview this. Please follow the instructions listed there and let me know if you have any issue.

LeoHere avatar Nov 06 '18 12:11 LeoHere

@LeoHere - I followed the directions in there but it doesn't work when the top a page is inhereted from some type like BaseContentPage which inherits ContentPage. I added that type to the LoadApplication but it doesn't know that the basecontentpage is a contentpage still.

radderz avatar Nov 27 '18 05:11 radderz

@radderz can you attach your MainActivity.cs if you are in Android or AppDelegate.cs if iOS. Can you attach a screenshot of the error you are seeing please?

LeoHere avatar Nov 27 '18 11:11 LeoHere

Hi @LeoHere, the error is identical to the above error, Root XAML element unrecognised.

My pages inherit from basecontentpage which inherits from contentpage <?xml version="1.0" encoding="utf-8" ?> <views:BaseContentPage xmlns="http://xamarin.com/schemas/2014/forms"

This is my LoadApplication

LoadApplication(UXDivers.Gorilla.Droid.Player.CreateApplication( this, new UXDivers.Gorilla.Config(new Uri("http://192.168.98.199:9014"), true) .RegisterAssemblyFromType<BaseContentPage>() .RegisterAssemblyFromType<FFImageLoading.Forms.CachedImage>() ));

radderz avatar Nov 27 '18 19:11 radderz

@radderz

I asked for the screenshot because I want to make sure you are running your Gorilla SDK and not the Player app (previously available in the stores).

Does your Gorilla navigation bar looks like in the screenshot below? Is it orange or red?

image

Orange (as in the screenshot) means you are running the Player app, that you get from the store or you deploy yourself. Not Gorilla SDK. Red means you are running Gorilla SDK.

Also, what version of Gorilla SDK are you using?

LeoHere avatar Nov 27 '18 21:11 LeoHere