Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] don't add exported="true" if already pr…
…esent (#6290) Fixes: #6284 Building an Android application with: [Activity( MainLauncher = true, Exported = true, //... Fails with: Xamarin.Android.Common.targets(1424,3): error XAGJS7009: System.InvalidOperationException: Duplicate attribute. at System.Xml.Linq.XElement.AddAttributeSkipNotify(XAttribute a) at System.Xml.Linq.XContainer.AddContentSkipNotify(Object content) at System.Xml.Linq.XContainer.Add(Object content) at Xamarin.Android.Tasks.ManifestDocument.AddLauncherIntentElements(XElement activity) at Xamarin.Android.Tasks.ManifestDocument.<>c__DisplayClass99_0.<ActivityFromTypeDefinition>b__1(ActivityAttribute aa, XElement element) at Xamarin.Android.Tasks.ManifestDocument.ToElement[TAttribute](TypeDefinition type, String name, Func`2 parser, Func`2 toElement, Action`2 update) at Xamarin.Android.Tasks.ManifestDocument.ActivityFromTypeDefinition(TypeDefinition type, String name, Int32 targetSdkVersion) at Xamarin.Android.Tasks.ManifestDocument.Merge(TaskLoggingHelper log, TypeDefinitionCache cache, List`1 subclasses, String applicationClass, Boolean embed, String bundledWearApplicationName, IEnumerable`1 mergedManifestDocuments) at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res) at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in external\xamarin-android-tools\src\Microsoft.Android.Build.BaseTasks\AndroidTask.cs:line 17 In d304060, I added the automatic inclusion of `android:exported="true"` for activities, but we should only do this if the attribute is not present. I updated a test for this scenario.
- Loading branch information