Iconize
Iconize copied to clipboard
UWP: Ionicons not work in Release mode or appxbundle
Running application in Visual Studio Debug mode work fine, the icons are displayed. But when install by blundled app (appxbundle) or run on Release mode, the icons not displayed, only appear names (ex: ion-calendar, ion-book ...).
Run on Debug:
Run on Release:
I have the same issue with FontAwesome.
Okay so following this Xamarin guidance fixed it for me. Essentially I have added the following to my UWP App.xaml.cs (perhaps all the registrations aren't needed, I haven't tested which ones are definitely required to fix it, but it works anyway):
List<Assembly> assembliesToInclude = new List<Assembly>
{
typeof(Iconize).GetTypeInfo().Assembly,
typeof(Plugin.Iconize.Fonts.FontAwesomeModule).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.IconLabel).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.IconButton).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.IconTabbedPage).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.IconImage).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.IconNavigationPage).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.IconCarouselPage).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.IconToolbarItem).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.ToolbarItemExtensions).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.UWP.IconButtonRenderer).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.UWP.IconLabelRenderer).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.UWP.ColorExtensions).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.UWP.IconImageRenderer).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.UWP.IconNavigationRenderer).GetTypeInfo().Assembly,
typeof(FormsPlugin.Iconize.UWP.IconControls).GetTypeInfo().Assembly,
typeof(Plugin.Iconize.IconModule).GetTypeInfo().Assembly,
typeof(Plugin.Iconize.Extensions).GetTypeInfo().Assembly,
typeof(Plugin.Iconize.Iconize.IconizeInitializer).GetTypeInfo().Assembly,
typeof(Plugin.Iconize.Icon).GetTypeInfo().Assembly
};
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
I only needed the following for the Material and material design fonts I used...
var assembliesToInclude = new List<Assembly>
{
typeof(Plugin.Iconize.Iconize).GetTypeInfo().Assembly,
typeof(Plugin.Iconize.Fonts.MaterialModule).GetTypeInfo().Assembly,
typeof(Plugin.Iconize.Fonts.MaterialDesignIconsModule).GetTypeInfo().Assembly
};
Xamarin.Forms.Forms.Init(e, assembliesToInclude);