I'm new to android application building using cordova-android.
I'm facing issue when updating compileSdkVersion/buildToolsVersion in config.xml of project root directory.
As cordova-android version-9 support api level 29 but as Android SDK API level 30 is available and cordova-android still not provided support yet.
I tried updating preferences compileSdkVersion/buildToolsVersion like below in config.xml
<?xml version='1.0' encoding='utf-8'?>
My first app
Test application
Your Name Here
Can someone help me in updating above two properties, so that apk can be build with latest SDK API level 30.
Cordova 11.0.0 is out, but to update this highly ranked question, you have to add the following to your config.xml:
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="31" />
<preference name="android-compileSdkVersion" value="31" />
Additionally, apps which target Android 12+ have to add
android:exported="true"
to all Activity and Requirement statements in your manifest -- I had to add this in several places manually to accommodate older plugins.
Based on Cordova requirements and support, current cordova-android@9 supports API level 29 and below. We can expect that next version cordova-android@10 will likely to target API level 30 and may need to wait for an official update from Cordova team.

Until then we can play around with the nightly version of
cordova-android@10fromnpm
According to the recent deadlines from Google,
August 2021 - New apps must target at least Android 11 (API level 30)
November 2021 - Existing apps must target at least Android 11 (API level 30) for new app updates
So we can wait till August for an official update :).
Workaround :
(may or may not work. Use it in a sample application before implementing in the real application)
Change android-targetSdkVersion on config.xml
<preference name="android-targetSdkVersion" value="30" />
Remove the platform by using
cordova platform remove android
then add the latest cordova android version :
cordova platform add android@latest
Build the project :
cordova build android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With