I am currently creating my first project with Telerik Maui. In the MauiProgram.cs file, 3 lines are underlined in green.
"This call site is reachable on: 'Android' 21.0 and later. 'RadAppHostBuilderExtensions.UseTelerik(MauiBuilder)' is only supported on: 'Windows' 10.0.17763.0 and later"
is displayed as a warning message. The program compiles and runs without errors on Windows.
On Android I get the following error message:
System.TypeLoadException: 'Could not load type of field 'Telerik.Maui.TelerikFont:UsePlatformFontProperty' (84) due to: Could not load file or assembly 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' or one of its dependencies.'
Here is the code (The affected lines are marked in green) :
using Telerik.Maui.Controls.Compatibility;
namespace xxx;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseTelerik()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("ionicons.ttf", "IonIcons");
});
builder.Services.AddSingleton<MainPage>();
builder.Services.AddTransient<PageList>();
return builder.Build();
}
}
One of the advances of Maui over Xamarin is that only one code base is required for different platforms.
Does this also apply to the Telerik Maui Library?