Closed z-eh closed 7 months ago
Do you have using Avalonia.Maui;
in your file? This code should be enough, and you can try it in our samples.
Yes I have, that's not the issue. The issue is, that in the following part of the code: As you can see somehow the system selects the last one instead of the iOS part.
I made a repo which can help to reproduce the issue: https://github.com/z-eh/avalonia-maui-bug-repro
I can build your repro with no issues
@z-eh can you try to run "dotnet build" on your solution? And if there is an error - send it here. Possibly you are missing .NET workloads.
As you can see somehow the system selects the last one instead of the iOS part.
It's just an IDE showing the least specific option. During the build, for "net8.0-ios" project "#if IOS" branch should be selected.
Hi, my workloads are fine, but something is not okay. Workloads:
I got the root cause of the issue. My .NET 8 SDK was at version 8.0.200, after I upgraded it to the 8.0.201 the issue is resolved. Thanks for the tips.
I use the following versions: .NET 8 Avalonia.iOS: 11.0.9 Avalonia.Maui: 11.0.9 Microsoft.Maui.Controls: 8.0.7 Microsoft.Maui.Essentials: 8.0.7
Steps to reproduce: Follow the guide in the README.md When you reach the point when you need to use the UseMaui() extension method you can see, that not selecting the required extension method for iOS which requires the AppDelegate instance, instead it uses the simple UseMaui method with the AppBuilder.