Your app currently targets API level 29 and must target at least API level 31 to ensure that it is built on the latest APIs optimised for security and performance. Change your app’s target API level to at least 31. Learn more
I got the above error in android place store when I tried to upload ionic cordova build into google playstore
This message indicates that your Ionic app currently targets API level 29, which is outdated, and Google Play Store requires apps to target at least API level 31 to ensure the latest security and performance optimizations are applied.
To update your app’s target API level, you need to modify the android-targetSdkVersion
property in the config.xml
file of your Ionic app.
- Open the
config.xml
file in your project’s root directory. - Locate the
<platform name="android">
section and find theandroid-targetSdkVersion
property. - Change the value of the
android-targetSdkVersion
property to “31” or higher. - Save the changes to the
config.xml
file.
<code class=""><preference name="targetSdkVersion" value="31" /></code>
After making these changes, rebuild your app using the following command:
<code class="">ionic cordova build android --prod --release</code>
This will generate a new APK that targets API level 31, which can be uploaded to the Google Play Store.
Your app currently targets API level 30 and must target at least API level 31 to ensure that it is built on the latest APIs optimised for security and performance. Change your app’s target API level to at least 31
<code class="">ionic cordova platform remove android ionic cordova platform add android@11</code>