-
Notifications
You must be signed in to change notification settings - Fork 533
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
Don't use Dictionary<K,V> to avoid duplicate value exception #7340
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes: dotnet#7302 Context: dotnet@7117414 When building .NET6 app on .NET7, sometimes the build fails with: 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 Avoid that by switching the data structure to `List<T>`, since we no longer use the Dictionary key for anything.
grendello
requested review from
dellis1972 and
jonathanpeppers
as code owners
September 6, 2022 15:26
jonathanpeppers
approved these changes
Sep 6, 2022
dellis1972
approved these changes
Sep 6, 2022
jonathanpeppers
pushed a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Sep 6, 2022
…7340) Fixes: dotnet#7302 Context: dotnet@7117414 When building .NET6 app on .NET7, sometimes the build fails with: 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 Avoid that by switching the data structure to `List<T>`, since we no longer use the Dictionary key for anything.
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Sep 6, 2022
* main: [FabricBot] Add `possibly-stale` GitHub label for closing old issues (dotnet#7343) Don't use Dictionary<K,V> to avoid duplicate value exception (dotnet#7340) [One .NET] fix `dotnet run -c Release` (dotnet#7341)
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Sep 6, 2022
* mm-runtime: [FabricBot] Add `possibly-stale` GitHub label for closing old issues (dotnet#7343) Don't use Dictionary<K,V> to avoid duplicate value exception (dotnet#7340) [One .NET] fix `dotnet run -c Release` (dotnet#7341)
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Sep 6, 2022
* mm-cleanup-and-enable: [FabricBot] Add `possibly-stale` GitHub label for closing old issues (dotnet#7343) Don't use Dictionary<K,V> to avoid duplicate value exception (dotnet#7340) [One .NET] fix `dotnet run -c Release` (dotnet#7341) Make AOT work (with trimming) Fix Debug mode and Release w/o marshal methods
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #7302
Context: 7117414
When building .NET6 app on .NET7, sometimes the build fails with:
Avoid that by switching the data structure to
List<T>
, since we nolonger use the Dictionary key for anything.