Question

Uploaded an APK which has an activity, activity alias, service or broadcast receiver with intentfilter, but without 'android : exported' property set

I'm having an issue when I'm uploading an app bundle to the play console that:

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.

But my manifest file includes the property.

Manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="**********">
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
    <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />

    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="*****"
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true"
        android:icon="@mipmap/ic_launcher">

        <meta-data
          android:name="com.google.firebase.messaging.default_notification_icon"
          android:resource="@drawable/ic_stat_artboard_1" />

        <meta-data android:name="com.google.android.geo.API_KEY"
            android:value="Z*********"/>

        <provider
            android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
            android:authorities="im.mingguang.mingguang_app.flutter_downloader.provider"
            android:grantUriPermissions="true"
            android:requestLegacyExternalStorage="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths"/>
        </provider>

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:grantUriPermissions="true">

            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths"/>
        </provider>

        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:exported="true"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

Play Console Error

Enter image description here

 46  34392  46
1 Jan 1970

Solution

 21

I solved it by writing

android:exported="true"

in activity below the android:name=".MainActivity".

Image shown

2022-01-12

Solution

 21

I solved it by writing

android:exported="true"

in activity below the android:name=".MainActivity".

Image shown

2022-01-12

Solution

 13

On about the 11th of January 2022, the Play Store introduced a lint check when uploading APKs to verify exported attributes are set correctly in the manifest.

Tools like DexGuard that obfuscate attribute names will cause the Play Store linter to fail, since it will be unable to check for exported attributes.

To fix this, configure obfuscation tools to keep attribute names in the manifest.

Here is the rule we used for DexGuard:

-keepresourcexmlattributenames manifest/**
2022-01-13

Solution

 13

On about the 11th of January 2022, the Play Store introduced a lint check when uploading APKs to verify exported attributes are set correctly in the manifest.

Tools like DexGuard that obfuscate attribute names will cause the Play Store linter to fail, since it will be unable to check for exported attributes.

To fix this, configure obfuscation tools to keep attribute names in the manifest.

Here is the rule we used for DexGuard:

-keepresourcexmlattributenames manifest/**
2022-01-13