Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No embedded resource found

I have a xamarin forms application where the very first page has a image control which displays a embedded resource. Often, when i run the application, it fails during start-up with following error:

[libc] WARNING: generic atexit() called from legacy shared library
[monodroid-gc] GREF GC Threshold: 46800
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Xamarin.Forms.Xaml.XamlParseException: No embeddedresources found for SeeVee.StartPage
[MonoDroid]   at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x00000] in <filename unknown>:0 
[MonoDroid]   at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[StartPage] (SeeVee.StartPage view, System.Type callingType) [0x00000] in <filename unknown>:0 
[MonoDroid]   at SeeVee.StartPage.InitializeComponent () [0x00000] in <filename unknown>:0 
[MonoDroid]   at SeeVee.StartPage..ctor () [0x00000] in <filename unknown>:0 
[MonoDroid]   at SeeVee.App.GetMainPage () [0x00000] in <filename unknown>:0 
[MonoDroid]   at SeeVee.Android.MainActivity+<OnCreate>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[mono] 
[mono] Unhandled Exception:
[mono] Xamarin.Forms.Xaml.XamlParseException: No embeddedresources found for SeeVee.StartPage
[mono]   at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x00000] in <filename unknown>:0 
[mono]   at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[StartPage] (SeeVee.StartPage view, System.Type callingType) [0x00000] in <filename unknown>:0 
[mono]   at SeeVee.StartPage.InitializeComponent () [0x00000] in <filename unknown>:0 
[mono]   at SeeVee.StartPage..ctor () [0x00000] in <filename unknown>:0 
[mono]   at SeeVee.App.GetMainPage () [0x00000] in <filename unknown>:0 
[mono]   at SeeVee.Android.MainActivity+<OnCreate>d__0.MoveNext () [0x00000] in <filename unknown>:0 
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: Xamarin.Forms.Xaml.XamlParseException: No embeddedresources found for SeeVee.StartPage
[mono-rt]   at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x00000] in <filename unknown>:0 
[mono-rt]   at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[StartPage] (SeeVee.StartPage view, System.Type callingType) [0x00000] in <filename unknown>:0 
[mono-rt]   at SeeVee.StartPage.InitializeComponent () [0x00000] in <filename unknown>:0 
[mono-rt]   at SeeVee.StartPage..ctor () [0x00000] in <filename unknown>:0 
[mono-rt]   at SeeVee.App.GetMainPage () [0x00000] in <filename unknown>:0 
[mono-rt]   at SeeVee.Android.MainActivity+<OnCreate>d__0.MoveNext () [0x00000] in <filename unknown>:0 

I have to rebuild the app in xamarin studio and re-run and it works. Phew! this gets very tiring sometimes. I hope xamarin is aware of this silly bug and will fix it.

like image 961
Kartik Avatar asked Jan 12 '15 06:01

Kartik


1 Answers

It's a bug. For some reason its status is RESOLVED FIXED, but it doesn't seem fixed at all. On XS on mac anyway.

As a workaround, the file that the exception is thrown in, SomeClass.g.cs, just make an edit to that one generated file, save it, and build again. A bit faster than rebuilding everything.

Of course this means every time you change a .xaml file, you have to build twice.

like image 169
akevan Avatar answered Oct 13 '22 21:10

akevan