unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.97k stars 730 forks source link

Uno.Microsoft.Toolkit.Uwp.UI.Controls is not compatible with Uno.WinUI #4622

Closed talkravi closed 1 year ago

talkravi commented 3 years ago

My iOS builds started failed with C:\Users\ravi_.nuget\packages\uno.sourcegenerationtasks\2.0.13\build\netstandard1.0\Uno.SourceGenerationTasks.targets(127,2): error : An item with the same key has already been added.

See the attached binlog

Environment

Nuget Package Version(s):3.3.0

Affected platform(s):

IDE: unoissue.zip

jeromelaban commented 3 years ago

Thanks for the report.

Could you try again with the latest Uno.UI dev bits ? We've adjusted some portions that may be related.

talkravi commented 3 years ago

No luck with Uno.UI v3.4.0-dev.245 and Uno.SourceGenerationTasks v3.0.0.dev.21.

.nuget\packages\uno.sourcegenerationtasks\3.0.0-dev.21\build\netstandard1.0\Uno.SourceGenerationTasks.targets(134,2): error : An item with the same key has already been added.

jeromelaban commented 3 years ago

Thanks! Can you try running the build in command line by using msbuild /r /bl and post he binlog file here?

talkravi commented 3 years ago

unoissue.zip See attached.

jeromelaban commented 3 years ago

Thank you. The reason this happens is that you're using Uno.WinUI, and referencing Uno.Microsoft.Toolkit.Uwp.UI.Controls which is not compatible with it.

Are you testing currently experimenting with WinUI 3, or can you use Uno.UI (uwp compatible) instead ?

talkravi commented 3 years ago

I reworked the code to not use Microsoft.Toolkit.Uwp.UI.Controls anymore - was predominantly using ExpanderControl.

I am still using TabView and TreeView from Win UI 2.5.0(not WinUI 3) - is that supported ? Everything works fine with UWP head but not IOS and Android.

For Android I still get the same error error : An item with the same key has already been added.

For iOS (None of these before I added Win UI. System.AggregateException: One or more errors occurred. ---> System.Exception: Processing failed for file C:\Dayglows\Source\Applications\Vivid\DotNet\Uno\Dayglows.Applications.Vivid.Uno.Shared....\UWA\Dayglows.Applications.Vivid.UWA\App.xaml (System.InvalidOperationException: Unable to resolve Application (Reason: None, Location:Unknown, Candidates: )

jeromelaban commented 3 years ago

This is the same error as the others, you cannot have a mix of references between Uno.UI and Uno.WinUI. For now the WinUI 3.0 support is experimental, and if you have mixed references, the build will fail with errors such as the one you provided.

Try making your application work properly with Uno.UI first, then once the WinUI 3.0 support progresses, you'll be able to migrate there.

MartinZikmund commented 1 year ago

This should no longer be relevant, as we have proper support for both Uno.UI and Uno.WinUI and also because Community Toolkit is in progress of getting first party support for Uno Platform.