1

Here's the error :

System.InvalidOperationException: Duplicate Attribute.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error XAGJS7009: System.InvalidOperationException: Duplicate attribute.
      at System.Xml.Linq.XElement.AddAttributeSkipNotify (System.Xml.Linq.XAttribute a) [0x00030] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs:1929 
      at System.Xml.Linq.XContainer.AddContentSkipNotify (System.Object content) [0x00032] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.Private.Xml.Linq/src/System/Xml/Linq/XContainer.cs:486 
      at System.Xml.Linq.XContainer.Add (System.Object content) [0x00008] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.Private.Xml.Linq/src/System/Xml/Linq/XContainer.cs:140 
      at Xamarin.Android.Tasks.ManifestDocument.AddLauncherIntentElements (System.Xml.Linq.XElement activity) [0x0004e] in <256050d9b61b4848876345a052636c75>:0 
      at Xamarin.Android.Tasks.ManifestDocument+<>c__DisplayClass99_0.<ActivityFromTypeDefinition>b__1 (Android.App.ActivityAttribute aa, System.Xml.Linq.XElement element) [0x00008] in <256050d9b61b4848876345a052636c75>:0 
      at Xamarin.Android.Tasks.ManifestDocument.ToElement[TAttribute] (Mono.Cecil.TypeDefinition type, System.String name, System.Func`2[T,TResult] parser, System.Func`2[T,TResult] toElement, System.Action`2[T1,T2] update) [0x0007d] in <256050d9b61b4848876345a052636c75>:0 
      at Xamarin.Android.Tasks.ManifestDocument.ActivityFromTypeDefinition (Mono.Cecil.TypeDefinition type, System.String name, System.Int32 targetSdkVersion) [0x00043] in <256050d9b61b4848876345a052636c75>:0 
      at Xamarin.Android.Tasks.ManifestDocument.Merge (Microsoft.Build.Utilities.TaskLoggingHelper log, Java.Interop.Tools.Cecil.TypeDefinitionCache cache, System.Collections.Generic.List`1[T] subclasses, System.String applicationClass, System.Boolean embed, System.String bundledWearApplicationName, System.Collections.Generic.IEnumerable`1[T] mergedManifestDocuments) [0x004c2] in <256050d9b61b4848876345a052636c75>:0 
      at Xamarin.Android.Tasks.GenerateJavaStubs.Run (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x00766] in <256050d9b61b4848876345a052636c75>:0 
      at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask () [0x0000e] in <256050d9b61b4848876345a052636c75>:0 
      at Microsoft.Android.Build.Tasks.AndroidTask.Execute () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:17  (XAGJS7009) (AppName.UI.Droid)

It only appears when I target android 12

1 Answer 1

2

The solution was to remove the explicit exported flag for the activity, that I have added before because of the error it was giving me when targeting Android SDK 11.0.99

I have only removed the splash screen exported flag and the app runs normally

Here is the issue information: https://github.com/xamarin/xamarin-android/issues/6463

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.