android: After update cannot build Android with error: Xamarin.Android.Common.targets (1392, 3): [XAGJS7009] System.InvalidOperationException: Duplicate attribute.
Build stack:
Xamarin.Android.Common.targets(1392, 3): [XAGJS7009] System.InvalidOperationException: Duplicate attribute.
at System.Xml.Linq.XElement.AddAttributeSkipNotify (System.Xml.Linq.XAttribute a) [0x0000e] in <7a9b77c9c73b43f99a32b1ba98596ce4>:0
at System.Xml.Linq.XContainer.AddContentSkipNotify (System.Object content) [0x00032] in <7a9b77c9c73b43f99a32b1ba98596ce4>:0
at System.Xml.Linq.XContainer.Add (System.Object content) [0x00008] in <7a9b77c9c73b43f99a32b1ba98596ce4>:0
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.Func2[T,TResult] parser, System.Func2[T,TResult] toElement, System.Action2[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.List1[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 <f24af698a51a478ab00657efe7dfcbde>:0
Version Information
=== Visual Studio Community 2019 for Mac ===
Version 8.10.12 (build 16) Installation UUID: a69fd0e8-a0ec-4b44-b769-73b2bbcb5b6d GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
Package version: 612000140
=== Mono Framework MDK ===
Runtime: Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit) Package version: 612000140
=== Roslyn (Language Service) ===
3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
=== NuGet ===
Version: 5.9.0.7134
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/5.0.402/Sdks SDK Versions: 5.0.402 5.0.401 5.0.400 5.0.302 5.0.301 5.0.203 5.0.202 5.0.201 5.0.103 5.0.102 5.0.101 5.0.100 3.1.414 3.1.413 3.1.412 3.1.411 3.1.410 3.1.409 3.1.408 3.1.407 3.1.406 3.1.405 3.1.404 3.1.403 3.1.402 3.1.401 3.1.302 3.1.301 3.1.300 3.1.202 3.1.200 3.1.102 3.1.101 3.1.100 3.0.101 3.0.100 2.1.701 2.1.700 2.1.505 2.1.504 2.1.503 2.1.302 2.1.301 2.1.4 MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 5.0.11 5.0.10 5.0.9 5.0.8 5.0.7 5.0.6 5.0.5 5.0.4 5.0.3 5.0.2 5.0.1 5.0.0 3.1.20 3.1.19 3.1.18 3.1.17 3.1.16 3.1.15 3.1.14 3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.1 3.0.0 2.1.23 2.1.22 2.1.21 2.1.20 2.1.19 2.1.18 2.1.17 2.1.16 2.1.15 2.1.14 2.1.13 2.1.12 2.1.11 2.1.9 2.1.8 2.1.7 2.1.2 2.1.1 2.0.5
=== .NET Core 3.1 SDK ===
SDK: 3.1.414
=== Xamarin.Profiler ===
‘/Applications/Xamarin Profiler.app’ not found
=== Updater ===
Version: 11
=== Xamarin Designer ===
Version: 16.11.0.39 Hash: cd672761d Branch: remotes/origin/d16-11 Build date: 2021-10-06 20:09:18 UTC
=== Apple Developer Tools ===
Xcode 13.0 (19234) Build 13A233
=== Xamarin.Mac ===
Version: 8.2.0.1 (Visual Studio Community) Hash: 8fd9e6289 Branch: xcode13.1 Build date: 2021-10-26 10:13:55-0400
=== Xamarin.iOS ===
Version: 15.2.0.1 (Visual Studio Community) Hash: 8fd9e6289 Branch: xcode13.1 Build date: 2021-10-26 10:13:56-0400
=== Xamarin.Android ===
Version: 12.0.0.3 (Visual Studio Community) Commit: xamarin-android/d16-11/f0e3c2d Android SDK: /Users/matteo/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 7.1 (API level 25) 8.1 (API level 27)
SDK Tools Version: 26.1.1 SDK Platform Tools Version: 30.0.5 SDK Build Tools Version: 30.0.2
Build Information: Mono: c633fe9 Java.Interop: xamarin/java.interop/d16-11@476bb5b ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@87af37b
=== Eclipse Temurin JDK ===
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home 1.8.0_302 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.10.0.13 Hash: 1b81df5 Branch: remotes/origin/d16-10 Build date: 2021-09-28 20:47:12 UTC
=== Android Device Manager ===
Version: 16.10.0.15 Hash: 89dcc0b Branch: remotes/origin/d16-10 Build date: 2021-09-28 20:47:30 UTC
=== Build Information ===
Release ID: 810120016 Git revision: e4f3f43ac50d8e0f83a71dbcb666bb1611a661d7 Build date: 2021-10-28 12:10:44-04 Build branch: release-8.10
=== Operating System ===
Mac OS X 10.16.0 Darwin 20.6.0 Darwin Kernel Version 20.6.0 Wed Jun 23 00:26:31 PDT 2021 root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64
=== Enabled user installed extensions ===
NuGet Package Management Extensions 0.27
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 29 (5 by maintainers)
Commits related to this issue
- Update build.yml — committed to kurema/EarphoneLeftAndRightAndroid by kurema 4 years ago
That newer Xamarin.Android versions are only in VS Mac 2022.
You can download the latest build from our release branches. The
JENKINS_SIGNGithub status has links.This corresponds to VS Windows 2022 17.1.
@rajeshrayudu the fix is in the coming .NET 6 release, but not yet in Xamarin.Android in VS Mac.
If you need the build now, you can use one of these builds:
for me only removing
Exported = truefrom the splash screen works tooThis is fixed in https://github.com/xamarin/xamarin-android/commit/9f2d3bfa4fe65eeb254ebc2382e862ba0e8c43b4. It should be going out in the next Xamarin.Android release.
The workaround is to remove
Exported = trueon any[Activity]attributes. Hope that helps, thanks!This is also an issue on Azure Pipelines, windows-2019 agent. However, windows-2022 agent does not have it.
It sounds good! I will try with your solution and let you know. Thanks for your updates!
On Sat, Apr 2, 2022 at 12:15 AM venkatsunilm @.***> wrote: