Cordova 6.3.1 plugin.xml set minSdkVersion doesn't work

那年仲夏 提交于 2019-12-10 10:39:45

问题


I'm working on a plugin for cordova and would like to set the minimum sdk version. However it isn't overwritten when I try to use these options in the plugin.xml file:

<platform name="android">
    <preference name="android-minSdkVersion" value="16" />
    <preference name="android-targetSdkVersion" value="23" />
</platform>

or in the manifest tag

<config-file target="AndroidManifest.xml" parent="/manifest">
     <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
</config-file>

These ways are both phonegap ways to set the sdk versions and, if I'm correct, still cordova ways. But the first one gives an error:

Failed to install 'plugin.demo':Error: Variable(s) missing: ANDROID-MINSDKVERSION, ANDROID-TARGETSDKVERSION

And the second option just add a new row with uses-sdk, which also creates a lot of errors.

How do I set the sdk version in cordova (v6+)?


回答1:


<config-file target="res/xml/config.xml" parent="/*">
    <preference name="android-minSdkVersion" value="15" />
</config-file>


来源:https://stackoverflow.com/questions/40403958/cordova-6-3-1-plugin-xml-set-minsdkversion-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!