I am getting below errors on my Xamarin Forms android project when updating the target version to 33.
Severity Code Description Project File Line Suppression State Error android:exported needs to be explicitly specified for element <service#crc6494e14b9856016c30.PNFirebaseIIDService>. 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. MyProject.Android \obj\Debug\110\AndroidManifest.xml 61
Severity Code Description Project File Line Suppression State Error android:exported needs to be explicitly specified for element <service#crc6494e14b9856016c30.PNFirebaseMessagingService>. 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. MyProject.Android \obj\Debug\110\AndroidManifest.xml 66
I am getting below errors on my Xamarin Forms android project when updating the target version to 33.
Severity Code Description Project File Line Suppression State Error android:exported needs to be explicitly specified for element <service#crc6494e14b9856016c30.PNFirebaseIIDService>. 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. MyProject.Android \obj\Debug\110\AndroidManifest.xml 61
Severity Code Description Project File Line Suppression State Error android:exported needs to be explicitly specified for element <service#crc6494e14b9856016c30.PNFirebaseMessagingService>. 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. MyProject.Android \obj\Debug\110\AndroidManifest.xml 66
I have added android:exported
values on Manifest
and MainActivity
files and close the project and did clean and rebuild.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.5" package="com.companyname.appname" android:installLocation="auto" android:versionCode="16">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="appname" android:usesCleartextTraffic="true" android:allowBackup="false" android:icon="@drawable/logo" android:requestLegacyExternalStorage="true">
<activity android:icon="@drawable/icon" android:name=".MainActivity" android:label="SmartWCM" android:exported="true">
<intent-filter>
<data android:scheme="https" android:host="www.smartwcm.com" android:pathPrefix="/domain" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<data android:scheme="http" android:host="www.smartwcm.com" android:pathPrefix="/domain" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.companyname.appname.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
</provider>
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
</application>
</manifest>
I have added exported value on activity, provider, FirebaseInstanceIdInternalReceiver and FirebaseInstanceIdReceiver
.
MainActivity
[Service(Exported = true)]
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })]
public class FirebaseNotificationService : FirebaseMessagingService
{
}
[Service(Exported = true)]
[IntentFilter(new[] { "com.google.firebase.INSTANCE_ID_EVENT" })]
public class FirebaseRegistrationService : FirebaseInstanceIdService
{
}
Added the same on FirebaseRegistrationService and FirebaseNotificationService under MainActivity.
But the error shows add it on PNFirebaseIIDService and PNFirebaseMessagingService
. But these properties are not added on my project.