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 attribute duplication error. I am stuck on this issue and I am getting no idea what to do please guide.
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.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 /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 Infinity.Android"
. I am stuck on this issue and I am getting no idea what to do please guide.
and updated api to 31 and target framework to v12
After this, you can try to run your peoject on the Android 12 emulator or the physical device. And the visual studio logcat will show the error message to tell you which component does't declare the android:exported
attribute and cause the issue.
There are two situations: