How to make app compatible with Android 12 (Snow Cone)

package.json
“cordova-android”: “^9.1.0”

build.gradle file:
defaultBuildToolsVersion=“29.0.2”
defaultMinSdkVersion=22
defaultTargetSdkVersion=30
defaultCompileSdkVersion=30

config.xml file:
preference name=“android-targetSdkVersion” value=“30”

==Tried increasing sdk to 31==
package.json file:
“cordova-android”: “^10.0.0”

build.gradle file:
defaultTargetSdkVersion=31
defaultCompileSdkVersion=31

config.xml file:
preference name=“android-targetSdkVersion” value=“31”

added android:exported=“true” in MainActivity in …\platforms\android\app\src\main\AndroidManifest.xml

Error :
FCMPlugin: Support for Gradle v4 or lower is deprecated. Please upgrade to a newer version.WARNING:: Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’ and ‘api’.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see Add build dependencies | Android Developers.
WARNING:: Using flatDir should be avoided because it doesn’t support any meta-data formats.

Task :app:processDebugMainManifest FAILED
…\platforms\android\app\src\main\AndroidManifest.xml Error:
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 | Android Developers for details.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ‘:app:processDebugMainManifest’.
Manifest merger failed : 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 | Android Developers for details.

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See Command-Line Interface

BUILD FAILED in 3s
15 actionable tasks: 1 executed, 14 up-to-date
Command failed with exit code 1: …\platforms\android\gradlew cdvBuildDebug -b …\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.

cordova.cmd build android exited with exit code 1.

Re-running this command with the --verbose flag may provide more information.