OYIon / LiveXAML

Xamarin Forms live UI update in an emulator
35 stars 2 forks source link

No embeddedresource found for App.<basepage> #67

Open mwasim opened 5 years ago

mwasim commented 5 years ago

Hi there, I reported this issue couple of weeks ago on the https://gitter.im/LiveXAML/Lobby

Now, I'm able to reproduce this issue as below, (It looks like it throws this error when we use the nested base page)

1). Create a new basic/blank Xamarin.Forms App (.NET standard) 2). Create a simple base page class as below,

public class BasePage : ContentPage
    {        
        public BasePage()
        {                        
        }
    }

2.1). Create another base page, which should inherit from the above base page,

<?xml version="1.0" encoding="utf-8" ?>
<app2:BasePage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:app2="clr-namespace:App2;assembly=App2"
             x:Class="App2.BaseScrollViewPage"/>

3). Now change the MainPage.xaml as below (it uses the BaseScrollViewPage instead of ContentPage)

<?xml version="1.0" encoding="utf-8" ?>
<local:BaseScrollViewPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:App2"
             x:Class="App2.MainPage">

    <ScrollView>
        <StackLayout>
            <!-- Place new controls here -->
            <Label Text="Hello World!" 
                   HorizontalOptions="Center"
                   VerticalOptions="CenterAndExpand" />
        </StackLayout>
    </ScrollView>
</local:BaseScrollViewPage>

4). Ensure LiveXAML VS extension and nuget packages are installed. Run the app, and try changing the text "Hello World!" to something else. it shows the error below,

**"LiveXAML error

No embeddedresource found for App.BaseScrollViewPage"**

Can this issue be fixed in the next update please?

ionoy commented 5 years ago

Hi @mwasim

Thanks for the report! I have already fixed this issue and will release the update soon. There is some other stuff that needs to be resolved yet.

GiampaoloGabba commented 5 years ago

Nice! I was ready to make a repro of this bug but then i saw this Issue. This is exactly the problem i faced. Thank you @ionoy for the upcoming fix :)

mwasim commented 5 years ago

Hi @ionoy, I'm no longer able to reproduce this issue, and it seems to be fixed in the latest nuget package release (2.1.45).

Thank you!

ionoy commented 5 years ago

Awesome!

mwasim commented 5 years ago

Hi @ionoy,

FYI, this issue has come back again in the latest LiveXAML update. I tried downgrading nuget packages but it doesn't help.

Could you please fix this bug in the next update?

ionoy commented 5 years ago

@mwasim Actually, I can't reproduce it with the same steps now. Can you try it on your end?

mwasim commented 5 years ago

Hi @ionoy, yes sorry I didn't test these simple steps, it's not reproducible with steps above.

Actually, I'm facing this issue on a complex page using BasePage and multiple custom controls. On testing again, I found it throws the error against a ContentView based control on the page (like below example). I removed that control and then, as I made simple text changes on the page, it started showing error "object reference not set".

Now it throws the error as below,

"LiveXAML error

No embeddedresource found for App.Controls.ContentViewBaseControl"

I'm trying to recreate this bug in a simple project with some simple steps. As I'll be able to find some simple steps to reproduce this bug, I'll let you know. Thanks

matteopiccioni commented 5 years ago

I had the same problem with 2.1.6.3 version, I roll back to version 2.1.5.9 and it works

So I try again to update to 2.1.6.3 and now it give me error "Exception has been thrown by the target of an invocation. No embeddedresource found for .....class"

Then I roll back again to 2.1.5.9 and now it works again

I am using Prism, an external ResourceDictionary files and in my App.xaml file I have:

<?xml version="1.0" encoding="utf-8"?>
<prism:PrismApplication
..
   <Application.Resources>
        <ResourceDictionary MergedWith="styles:Globale">               
            <local:InvertBooleanConverter x:Key="InvertBooleanConverter" />
        </ResourceDictionary>
   </Application.Resources>    
</prism:PrismApplication>
leo-mck commented 5 years ago

I am having this exactly same problem. If I directly change a xaml page it works, but if I change a resource defined on app.xaml, I get this error.

And even when it works, after a change, I cannot navigate to other screens, nothing happen.

On 2.1.5.9 I get other error: "Master and Detail must be set before adding MasterDetailPage to a container" but I can navigate out and back to see the changes.

I also use prism.

roubachof commented 5 years ago

Same issue as @matteopiccioni It works only on 2.1.59, 2.1.63 is failing on everypage reloading with "No embeddedresource found for .....class"

I don't use prism. And I have vanilla ContentPage.

nolanlater commented 5 years ago

I have the same issue as @leo-mck and @roubachof. I am using prism and also had to revert back to 2.1.59 from 2.1.68. Every page reload results in "No embedded resource found for x class" along with "Master and Detail must be set before adding...".

GiampaoloGabba commented 5 years ago

Getting the same error with TabbedPage (among other things like custom controls, ecc..). The only way to get updates is to revert to 2.1.59

francis2 commented 5 years ago

Same as tnolan2 here

balbarak commented 5 years ago

I have same issue any update ?

on

Xamarin.Forms 3.5.0.1699047

ionoy commented 5 years ago

Please try the latest update (2.1.70) which addresses this issue.

Thanks!

francis2 commented 5 years ago

Works for me--thanks!

mwasim commented 5 years ago

Yes it's working fine now, and the issue is no longer reproducible. Thank you!

sethom commented 5 years ago

I'm having this issue in Visual Studio for Mac using xamarin.forms 3.6.0.344457 and LiveXAML 2.1.72: "No embedded resource found for MyApp.Controls.SegmentedControl". If I remove the segmented control reference from xaml I just get an all new error for another xaml view: "No embeddedresource found for MyApp.HomeViewOverlay."

This seems to happen to any page in my project.

When I downgrade to 2.1.63 (and downgrade Xamarin.Forms) which was what I was using before Visual Studio 2019 for Mac was released, everything works again.

sethom commented 5 years ago

One more thing, I'm doing this in a PCL 4.5 - Profile111 project. Not sure if that matters.

sethom commented 5 years ago

Oh, forgot to mention. I'm not using Prism. Using Caliburn.Micro.