An element with the same key already exists in the dictionary. (XA0000)

Hi, trying to compile for release I get the error "An element with the same key already exists in the dictionary. (XA0000)", I have already created a new private keystore and added the condition below to my csproj, but seems this is not the solution.

Condition for release

     <PropertyGroup Condition="'$(Configuration)' == 'Release'">
        <AndroidKeyStore>True</AndroidKeyStore>
        <AndroidSigningKeyStore>appx.keystore</AndroidSigningKeyStore>
        <AndroidSigningStorePass>pass</AndroidSigningStorePass>
        <AndroidSigningKeyAlias>appx1</AndroidSigningKeyAlias>
        <AndroidSigningKeyPass>pass</AndroidSigningKeyPass>
      </PropertyGroup>

THe problem is here:

Xamarin.android.Common.targets

<Target Name="_Mandroid"
  DependsOnTargets="_BuildApkEmbed;_BuildApkBundle;_BuildApkFastDev"
  Inputs="$(MSBuildAllProjects);$(IntermediateOutputPath)android\bin\resources_and_assemblies"
  Outputs="$(ApkFile)">

  <Delete Files="$(ApkFileIntermediate)" Condition="Exists ('$(ApkFileIntermediate)')" />
  <Delete Files="$(ApkFile)" Condition="Exists ('$(ApkFile)')" />

  <Mandroid ///An element with the same key already exists in the dictionary. (XA0000)_
        AndroidEmbedProfilers="$(AndroidEmbedProfilers)"
        Assemblies="$(OutDir)$(TargetFileName);@(ReferencePath)"
        I18nAssemblies="$(MandroidI18n)"
        UncompressedFileExtensions="$(AndroidStoreUncompressedFileExtensions)"
        BuildDirectory="$(MonoAndroidIntermediate)"
        ReferenceAssembliesDirectory="$(TargetFrameworkDirectory)"
        AndroidSdkDirectory="$(_AndroidSdkDirectory)"
        JavaSdkDirectory="$(_JavaSdkDirectory)"
        AndroidSdkPlatform="$(_AndroidApiLevel)"
        MonoAndroidToolsDirectory="$(_MonoAndroidToolsDirectory)"
        ResourceDirectory="$(MonoAndroidResDirIntermediate)"
        AssetDirectory="$(MonoAndroidAssetsDirIntermediate)"
        ManifestTemplate="$(_AndroidManifestAbs)"
        Package="$(_AndroidPackage)"
        NativeLibrary="@(AndroidNativeLibrary)"
        JavaSource="@(AndroidJavaSource)"
        Debug="$(AndroidIncludeDebugSymbols)"
        ExtraArgs="$(MandroidExtraArgs) $(MonoDroidExtraArgs)"
        SupportedAbis="$(AndroidSupportedAbis)"
        LinkMode="$(AndroidLinkMode)"
        UseSharedRuntime="$(AndroidUseSharedRuntime)"
        InputPackage="$(IntermediateOutputPath)android\bin\resources_and_assemblies"
        OutputPackage="$(ApkFileIntermediate)" />

  <Copy SourceFiles="$(ApkFileIntermediate)" DestinationFiles="$(ApkFile)" />

  <Delete Files="$(_UploadFlagFile)" Condition="Exists ('$(_UploadFlagFile)')" />
</Target>

I do not know why im getting this or how to solve it, any ideas? thanks in advance.

Sign In or Register to comment.