已添加具有相同密钥的项目 MAUI C#

emi*_*lim 7 .net c# android maui

当我尝试在发布模式下运行程序时,出现以下错误:

Severity    Code    Description Project File    Line    Suppression State
Error   XAGJS7004   System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Xamarin.Android.Tasks.TypeMapGenerator.GenerateRelease(Boolean skipJniAddNativeMethodRegistrationAttributeScan, List`1 javaTypes, String outputDirectory, ApplicationConfigTaskState appConfState)
   at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings(List`1 types, TypeDefinitionCache cache)
   at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res)
   at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask()
   at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 MauiApp1    C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.440\tools\Xamarin.Android.Common.targets   1438    
Run Code Online (Sandbox Code Playgroud)

这很奇怪,因为在调试模式下它工作正常,但我在网上找不到任何答案。 窗口片段

emi*_*lim 2

我通过卸载.net7解决了这个问题,我在毛伊岛的github页面上发现了同样问题的人,我认为它将来会得到解决。

遗憾的是毛伊岛尚未为 .net7 做好准备