Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settingsview not registered after NuGet install #31

Open
spenol opened this issue Jul 30, 2024 · 3 comments
Open

Settingsview not registered after NuGet install #31

spenol opened this issue Jul 30, 2024 · 3 comments

Comments

@spenol
Copy link

spenol commented Jul 30, 2024

Description

When Maui.SettingsView is installed via NuGet, it doesn't seem to register in the IDE - adding the reference .UseSettingsView() in MauiApp.CreateBuilder() isn't recognised, and adding xmlns:sv="clr-namespace:AiForms.Settings;assembly=SettingsView" into xaml isn't registered.

Steps to Reproduce

  1. Install Maui.SettingsView via NuGet
  2. Attempt to add .UseSettingsView() and xmln:sv reference in xaml isn't recognised.

Expected Behavior

.UseSettingsView() and xmln:sv references should be recognised once it's installed via NuGet

Actual Behavior

As above.

Platforms

  • Visual Studio Windows.

Basic Information

  • AiForms.SettingsView 1.0.12
  • Maui
@regolas
Copy link

regolas commented Aug 8, 2024

I am receiving a similar issue at this step. I added a using AiForms.Settings; to the MauiProgram.cs file and it will recognize .UseSettingsView()
It does debug under Android emulator. However, there is a global debugger error whenever using Windows machine to debug. I have not entered any other code for this package, yet.
I needed to fix it like this
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
.UseMauiCommunityToolkit();
#if DEBUG
// Bypass UseSettingsView on Windows in debug mode
if (!OperatingSystem.IsWindows())
{
builder.UseSettingsView();
}
#else
builder.UseSettingsView(true)
#endif
builder.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

        return builder.Build();
    }

@spenol
Copy link
Author

spenol commented Aug 9, 2024

Thank you @regolas that's helpful. I also note that when adding using AiForms.Settings, it's only recognised for iOS and not Android, Windows or MacOS.

Does anyone know if/when support of wider MAUI platforms may be included? If not, I may need to move to another solution, but don't really want to as SettingsView is by far the easiest way I've found to create settings pages....

If wider platforms aren't in scope in the near future, grateful for any easy-to-use alternatives...

@muak
Copy link
Owner

muak commented Aug 10, 2024

@spenol @regolas
Thank you for your report.

This issue does not occur in my environment (Mac / VS for Mac or Rider)
I have installed it from nuget and it is working fine on Android.
I have also released an application that uses this library.

It may be that this problem only occurs when deploying from Windows.
I would appreciate it if you could let me know if you find anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants