You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.ArgumentException: An item with the same key has already been added. Key: Android.Support.V4.Media.Session.MediaSessionCompat+IOnActiveChangeListenerImplementor
#102
Closed
GameXX opened this issue
May 19, 2020
· 4 comments
Good evening, I proceeded to update the Android project by migrating to AndroidX.
The xaml preview does not display the Android preview and gives the error reported below.
I have already read something similar at this link and I believe the problems are connected #71.
The difference is that I don't use anywhere in the code the "MediaSessionCompat" class.
Steps to Reproduce :
Migrate to AndroidX
Include any relevant Exception Stack traces, build logs, adb logs:
System.ArgumentException: An item with the same key has already been added. Key: Android.Support.V4.Media.Session.MediaSessionCompat+IOnActiveChangeListenerImplementor at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x002b5] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-10/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:677 at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-10/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:240 at Xamarin.AndroidDesigner.Java.JcwWrapperGenerator.GenerateAsync () [0x001b5] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Java/JcwWrapperGenerator.cs:32 at Xamarin.Designer.Tasks.WhenBoth[T1,T2] (System.Threading.Tasks.Task`1[TResult] task1, System.Threading.Tasks.Task`1[TResult] task2) [0x0003b] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer/Xamarin.Designer/TaskExtensions.cs:112 at Xamarin.AndroidDesigner.DesignerProject.SynchronizeAssemblies (System.Boolean firstSync) [0x001f1] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/DesignerProject.cs:1814 at Xamarin.Designer.Telemetry.TimingTaskExtensions.AsTimedOperationInternal (System.Threading.Tasks.Task originalTask, System.String eventName, Xamarin.Designer.Telemetry.ITelemetryCorrelation correlation, Xamarin.Designer.Telemetry.TelemetryProperties properties, Xamarin.Designer.Telemetry.ITimingReporter reporter, System.Boolean sendToTelemetry) [0x000d5] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer/Xamarin.Designer/Telemetry/DesignerTelemetry.cs:240 at Xamarin.AndroidDesigner.DesignerProject.InitializeIdeProjectAsync () [0x005e4] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/DesignerProject.cs:199 at Xamarin.AndroidDesigner.AndroidDesignerService.LoadProjectAsync (Xamarin.AndroidDesigner.IIdeProject ideProject, System.String resourcesDir, System.String projectResourcesDir) [0x00069] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/AndroidDesignerService.cs:540 at Xamarin.AndroidDesigner.MonoDevelop.AndroidProjectWrapper.FromProjectAsync (Xamarin.AndroidDesigner.AndroidDesignerService service, MonoDevelop.Projects.Project project) [0x00097] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner.MonoDevelop/AndroidProjectWrapper.cs:102 at Xamarin.Designer.Forms.XamarinStudioXamlPreviewerView.InitializeAndroidDesignerProject (MonoDevelop.Projects.DotNetProject androidProject) [0x00030] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.FormsPreviewer.MonoDevelop/Xamarin.Designer.Forms/XamarinStudioXamlPreviewerView.cs:575 at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer.EnsureAndroidIsReady () [0x00078] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:90 at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer.RenderOneXaml (MonoTouch.Design.XamlRenderContext context) [0x0004b] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:129 at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer.RenderXamls (MonoTouch.Design.XamlRenderContext context, System.Threading.CancellationToken token) [0x003c1] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:293
The text was updated successfully, but these errors were encountered:
Xamarin.Android Version:
Xamarin.AndroidX last update
Describe your Issue:
Good evening, I proceeded to update the Android project by migrating to AndroidX.
The xaml preview does not display the Android preview and gives the error reported below.
I have already read something similar at this link and I believe the problems are connected #71.
The difference is that I don't use anywhere in the code the "MediaSessionCompat" class.
Steps to Reproduce :
Migrate to AndroidX
Include any relevant Exception Stack traces, build logs, adb logs:
System.ArgumentException: An item with the same key has already been added. Key: Android.Support.V4.Media.Session.MediaSessionCompat+IOnActiveChangeListenerImplementor at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x002b5] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-10/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:677 at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-10/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:240 at Xamarin.AndroidDesigner.Java.JcwWrapperGenerator.GenerateAsync () [0x001b5] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/Java/JcwWrapperGenerator.cs:32 at Xamarin.Designer.Tasks.WhenBoth[T1,T2] (System.Threading.Tasks.Task`1[TResult] task1, System.Threading.Tasks.Task`1[TResult] task2) [0x0003b] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer/Xamarin.Designer/TaskExtensions.cs:112 at Xamarin.AndroidDesigner.DesignerProject.SynchronizeAssemblies (System.Boolean firstSync) [0x001f1] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/DesignerProject.cs:1814 at Xamarin.Designer.Telemetry.TimingTaskExtensions.AsTimedOperationInternal (System.Threading.Tasks.Task originalTask, System.String eventName, Xamarin.Designer.Telemetry.ITelemetryCorrelation correlation, Xamarin.Designer.Telemetry.TelemetryProperties properties, Xamarin.Designer.Telemetry.ITimingReporter reporter, System.Boolean sendToTelemetry) [0x000d5] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer/Xamarin.Designer/Telemetry/DesignerTelemetry.cs:240 at Xamarin.AndroidDesigner.DesignerProject.InitializeIdeProjectAsync () [0x005e4] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/DesignerProject.cs:199 at Xamarin.AndroidDesigner.AndroidDesignerService.LoadProjectAsync (Xamarin.AndroidDesigner.IIdeProject ideProject, System.String resourcesDir, System.String projectResourcesDir) [0x00069] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner/AndroidDesignerService.cs:540 at Xamarin.AndroidDesigner.MonoDevelop.AndroidProjectWrapper.FromProjectAsync (Xamarin.AndroidDesigner.AndroidDesignerService service, MonoDevelop.Projects.Project project) [0x00097] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Android/Xamarin.AndroidDesigner.MonoDevelop/AndroidProjectWrapper.cs:102 at Xamarin.Designer.Forms.XamarinStudioXamlPreviewerView.InitializeAndroidDesignerProject (MonoDevelop.Projects.DotNetProject androidProject) [0x00030] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.FormsPreviewer.MonoDevelop/Xamarin.Designer.Forms/XamarinStudioXamlPreviewerView.cs:575 at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer.EnsureAndroidIsReady () [0x00078] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:90 at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer.RenderOneXaml (MonoTouch.Design.XamlRenderContext context) [0x0004b] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:129 at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer.RenderXamls (MonoTouch.Design.XamlRenderContext context, System.Threading.CancellationToken token) [0x003c1] in /Users/runner/runners/2.165.0/work/1/s/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:293
The text was updated successfully, but these errors were encountered: