I'm having the issue 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 when uploading my apk.
My manifest.xml is as follows:
<application android:allowBackup="true" android:icon="@drawable/Icon" android:label="@string/application_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:windowSoftInputMode="adjustPan" android:exported="true" />
<activity android:name=".DirectoryFragment" android:windowSoftInputMode="adjustPan" android:exported="true"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="[API KEY]" />
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data android:name="io.fabric.ApiKey" android:value="[API KEY]" />
<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>
<provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
</provider>
</application>
I've done my research on this issue and have noted to add the android:exported property in my manifiest.xml. However, adding this property is not resolving the issue. It's hard for me to tell where this property is needed as I'm working in Visual Studio and don't have a manifest merger to work with. Am I missing something?
CodePudding user response:
Usually means that one of your project dependencies is merging information to the manifest during the build process. You would need to check if a dependency is not setting that value.
CodePudding user response:
First, referring to the official documentation Working with the Android Manifest., we should use IntentFilter
property in Activity.cs
and Service.cs
files instead of modifying AndroidManifest.xml.
Second, If the error occurred again, we should look at the resulting AndroidManifest in the obj/Debug/Android
folder and see what is actually being exported. If some plugins did not support Android 12, it will also cause this error.
Third, due to the google new policy If your app targets Android 12 or higher and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported: true attribute for these app components.
More information you can refer to Behavior changes: Apps targeting Android 12