-
Notifications
You must be signed in to change notification settings - Fork 564
Closed
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.needs-triageIssues that need to be assigned.Issues that need to be assigned.
Description
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
17.3.0
Description
Building an app can sometimes cause this:
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.451\tools\Xamarin.Android.Common.targets(1438,3): 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
Steps to Reproduce
- Build an app
- ? (maybe have a build failure of some kind)
- Rebuild, see the failure above.
- Clean bin/obj
- Rebuild, the build will succeed.
Did you find any workaround?
Cleaning bin/obj folders.
Relevant log output
Metadata
Metadata
Assignees
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.needs-triageIssues that need to be assigned.Issues that need to be assigned.