I have updated targetsdkversion from 30 to 31(andtio OS 12) facing the below issue.
java.exe error AMM0000: android:exported needs to be explicitly specified for element <service#com.microsoft.appcenter.push.TokenService>. Apps targeting Android 12
In my application im using firebase push notification service and i added all the services for notification related. The below code im using in Andriodmanifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.edmatix.parent.shemida" android:versionName="production.release.1.0.0.0" android:versionCode="20220818"> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" android:maxSdkVersion="31" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <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="SHEMIDA INTERNATIONAL SCHOOL" android:requestLegacyExternalStorage="true" android:preserveLegacyExternalStorage="true" android:icon="@drawable/SHEMIDA_Launcher" android:networkSecurityConfig="@xml/network_security_config"> <meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyAnvG581Y_oVWbDcwYNDy6v4CfRdtmU2CY" /> <uses-library android:name="org.apache.http.legacy" android:required="false" /> <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"> <service android:name="com.microsoft.appcenter.push.TokenService" android:exported="true"/> <service android:name="crc646c47bac7b09c0b0e.MyFirebaseIIDService" android:exported="true"/> <service android:name="crc646c47bac7b09c0b0e.MyFirebaseMessagingService" android:exported="true"/> <receiver android:name="crc64a93b901f58a35d0f.PushReceiver" android:exported="true"/> <service android:name="crc6494e14b9856016c30.PNFirebaseIIDService" android:exported="true"/> <service android:name="crc6494e14b9856016c30.PNFirebaseMessagingService" android:exported="true"/> <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>
Kindly help on this.