'How or Where Cordova platform add android get the minSdkVersion value?
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 ([email protected])
.
My gradle version is 4.7.
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Leandro La Polla |