'android:exported="true" not working and not letting flutter app be installed in phone

I am developing an app in flutter. It used to work fine, i have been installing it, using it on phone for 2 months. Today suddenly, i get the following error when i run this command flutter run.

adb: failed to install D: \Flutter BLE May 2022\ SW_Mobile_Platform\ build\ app\ outputs\ flutter - apk\ app.apk: Failure[INSTALL_PARSE_FAILED_MANIFEST_MALFORMED:
    Failed parse during installPackageLI: /data/app / vmdl116305539.tmp / base.apk(at Binary XML file line #187):
org.altbeacon.beacon.startup.StartupBroadcastReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when
intent filters are present]

I already have android:exported="true" added in my manifest under activity. Here's my Manifest file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ble_app_flutter">

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

    <uses-feature
        android:name="android.hardware.bluetooth.le"
        android:required="true" />
    <application
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:label="ble_app_flutter"
        android:usesCleartextTraffic="true">
        <activity
            android:name=".BLEActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:exported="true"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme" />
            <meta-data
                android:name="io.flutter.embedding.android.SplashScreenDrawable"
                android:resource="@drawable/launch_background" />

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </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>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source