xamarin issue:uploading app to play store with android 12 set eported=true

shahrukh hasan 6 Reputation points
2022-12-02T11:34:23.897+00:00

I am developing using Xamarin Forms and updated api to 31 and target framework to v12, uploading to the play store I am facing the error "You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. See: developer.android.com/about/versions/12/behavior-changes-12#exported". But when I set android:exported=false or true in activity attribute above my activity then I am unable to get even local build with the error "

=======================

Severity Code Description Project File Line Suppression State
Error 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.ToElementTAttribute
at Xamarin.Android.Tasks.ManifestDocument.ActivityFromTypeDefinition(TypeDefinition type, String name, Int32 targetSdkVersion)
at Xamarin.Android.Tasks.ManifestDocument.Merge(TaskLoggingHelper log, TypeDefinitionCache cache, List1 subclasses, String applicationClass, Boolean embed, String bundledWearApplicationName, IEnumerable1 mergedManifestDocuments)
at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 Infinity.Android"

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
{count} vote