Updated to Android 12 SDK - specify an explicit value for `android:exported

Alexander Blohmé 1 Reputation point
2022-10-26T17:48:24.987+00:00

I updated to Android 12 and suddenly got this strange error:

/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/AndroidManifest.xml(5,5): Error AMM0000: /Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/169/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.installations' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/167/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.components' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/73/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.datatransport' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/80/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.analytics.connector' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/95/jl/AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.base' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/168/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/75/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.encoders.json' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/166/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.installations.interop' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/172/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.messaging' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/163/jl/AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.cloudmessaging' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/159/jl/AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.common' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/102/jl/AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.tasks' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/77/jl/AndroidManifest.xml Warning:
Namespace 'com.google.firebase.iid.internal' used in: AndroidManifest.xml, AndroidManifest.xml.
/Users/alex/Projects/Projects/MyNewProject/MyNewProject.Android/obj/Debug/lp/161/jl/AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.stats' used in: AndroidManifest.xml, AndroidManifest.xml.

android:exported needs to be explicitly specified for element <service#com.MyNewProject.MyNewProject.Firebaseservices>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.  

Directory 'obj/Debug/lp/169' is from 'firebaseinstallations-17.0.2.aar'.
Directory 'obj/Debug/lp/167' is from 'firebasecomponents-17.0.1.aar'.
Directory 'obj/Debug/lp/73' is from 'Xamarin.Firebase.Datatransport.dll'.
Directory 'obj/Debug/lp/80' is from 'Xamarin.Firebase.Measurement.Connector.dll'.
Directory 'obj/Debug/lp/95' is from 'Xamarin.GooglePlayServices.Base.dll'.
Directory 'obj/Debug/lp/168' is from 'firebasecommon-20.1.2.aar'.
Directory 'obj/Debug/lp/75' is from 'Xamarin.Firebase.Encoders.JSON.dll'.
Directory 'obj/Debug/lp/166' is from 'firebaseinstallationsinterop-17.0.2.aar'.
Directory 'obj/Debug/lp/172' is from 'firebasemessaging-23.0.8.aar'.
Directory 'obj/Debug/lp/163' is from 'playservicescloudmessaging-17.0.2.aar'.
Directory 'obj/Debug/lp/159' is from 'playservicesbasement-18.1.0.aar'.
Directory 'obj/Debug/lp/102' is from 'Xamarin.GooglePlayServices.Tasks.dll'.
Directory 'obj/Debug/lp/77' is from 'Xamarin.Firebase.Iid.Interop.dll'.
Directory 'obj/Debug/lp/161' is from 'playservicesstats-17.0.3.aar'. (AMM0000) (MyNewProject.Android) java

I did trie to set exported:true but it didn't work

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