0

Good day,

I have a cordova mobile project, and I using "cordova platform add android" command to add my android platform.

In my config.xml, I set the minSdkVersion to 26 as follow:

<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
        <application android:allowBackup="false" />
        <application android:networkSecurityConfig="@xml/network_security_config" />
        <uses-sdk android:minSdkVersion="26" />
</edit-config>

When I run "cordova platform add android" command, the "/platforms/android" folder and its files will be removed and auto generated. after it auto generate, I check the cdv-gradle-config.json file under "platforms/android", and found the "MIN_SDK_VERSION": 22.

May I know where is this "22" come from? or any mistaken I did to cause this issue?

My cordova version is 10.0.0 (cordova-lib@10.1.0). My gradle version is 4.7.

Panadol Chong
  • 1,793
  • 13
  • 54
  • 119

1 Answers1

0

Set this code in config.xml

<preference name="android-minSdkVersion" value="22" /> 
<preference name="android-targetSdkVersion" value="31" />

This is the only tip that works.

Leandro Ariel
  • 727
  • 8
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 21 '22 at 09:42