科尔多瓦6.3.1 plugin.xml设置minSdkVersion不起作用 [英] Cordova 6.3.1 plugin.xml set minSdkVersion doesn't work

查看:73
本文介绍了科尔多瓦6.3.1 plugin.xml设置minSdkVersion不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Cordova制作插件,并希望设置sdk的最低版本。但是,当我尝试在plugin.xml文件中使用以下选项时,它不会被覆盖:

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>

或在清单标记中

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

这些方法都是设置sdk版本的phonegap方法,如果我正确的话,仍然是cordova方法。但是第一个错误:

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

第二个选项只是添加了一个新的带有uses-sdk的行,

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

如何在cordova(v6 +)中设置sdk版本?

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

推荐答案

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

这篇关于科尔多瓦6.3.1 plugin.xml设置minSdkVersion不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆