Skip to content
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

[Xamarin.Android.Build.Tasks] fix ArgumentException in GenerateCompressedAssembliesNativeSourceFiles #6032

Merged
merged 1 commit into from Jun 21, 2021

Conversation

jonathanpeppers
Copy link
Member

Context: https://dev.azure.com/xamarin/public/_build/results?buildId=41853&view=logs&j=9cf5f8f4-c6e1-5b84-8b95-5f96f5b2da57&t=837f1816-7880-57fc-23bc-a709d74f8097&l=22687

dotnet/maui is hitting a build error, such as:

error XAGCANSF7004: System.ArgumentException: An entry with the same key already exists.
error XAGCANSF7004:    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
error XAGCANSF7004:    at System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
error XAGCANSF7004:    at System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
error XAGCANSF7004:    at Xamarin.Android.Tasks.GenerateCompressedAssembliesNativeSourceFiles.GenerateCompressedAssemblySources()
error XAGCANSF7004:    at Xamarin.Android.Tasks.GenerateCompressedAssembliesNativeSourceFiles.RunTask()
error XAGCANSF7004:    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17

We believe there is somehow a duplicate assembly, but hard to tell
what is happening exactly from the .binlog.

Reviewing the <GenerateCompressedAssembliesNativeSourceFiles/>
MSBuild task, it appears the ContainsKey() check is not using the
correct key for the dictionary.

I fixed this issue and added a LogDebugMessage() call, so we can
figure out what is happening upstream in dotnet/maui.

…ssedAssembliesNativeSourceFiles

Context: https://dev.azure.com/xamarin/public/_build/results?buildId=41853&view=logs&j=9cf5f8f4-c6e1-5b84-8b95-5f96f5b2da57&t=837f1816-7880-57fc-23bc-a709d74f8097&l=22687

dotnet/maui is hitting a build error, such as:

    error XAGCANSF7004: System.ArgumentException: An entry with the same key already exists.
    error XAGCANSF7004:    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
    error XAGCANSF7004:    at System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
    error XAGCANSF7004:    at System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
    error XAGCANSF7004:    at Xamarin.Android.Tasks.GenerateCompressedAssembliesNativeSourceFiles.GenerateCompressedAssemblySources()
    error XAGCANSF7004:    at Xamarin.Android.Tasks.GenerateCompressedAssembliesNativeSourceFiles.RunTask()
    error XAGCANSF7004:    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17

We believe there is somehow a duplicate assembly, but hard to tell
what is happening exactly from the `.binlog`.

Reviewing the `<GenerateCompressedAssembliesNativeSourceFiles/>`
MSBuild task, it appears the `ContainsKey()` check is not using the
correct key for the dictionary.

I fixed this issue and added a `LogDebugMessage()` call, so we can
figure out what is happening upstream in dotnet/maui.
@jonathanpeppers jonathanpeppers merged commit fc74854 into xamarin:main Jun 21, 2021
@jonathanpeppers jonathanpeppers deleted the argumentexception branch June 21, 2021 13:27
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants