如何在PhoneGap中指定Android API级别? [英] How do I specify the Android API Level in PhoneGap?

查看:222
本文介绍了如何在PhoneGap中指定Android API级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认PhoneGap应用程序想让我获得API 17.但是我有18,而宁愿使用它。如何指定要使用的API的版本?我在我的项目中做了一些配置文件的搜索,但没有看到任何指定级别为17。

The default PhoneGap app wants me to get API 17. However I have 18 and would rather use that. How do I specify which version of the API to use? I did some searching of some config files in my project but didn't see anything specifying the level to be 17.

我在Windows上开发,并希望构建android

I'm developing on Windows and want to build android locally.

我遵循开发者指南,因此我有一个名为hello的phonegap项目,其中包含以下文件夹:

I've followed the developer guide so that I have a phonegap project called hello that has the following folders:


  • .cordova

    • 钩子

    • config.json


    • css


    • js

    • res

    • spec

    • config.xml

    • icon.png

    • index.html

    • spec.html

    • css
    • img
    • js
    • res
    • spec
    • config.xml
    • icon.png
    • index.html
    • spec.html

    我尝试了 phonegap add platform android code>'platform add android'不是节点

    I tried phonegap add platform android but errored saying 'platform add android' is not a node

    推荐答案

    AndroidManifest.xml 。使用当前的cordova / phonegap版本,这不应该了(你可以忽略平台从版本控制!)。

    Please do not modify AndroidManifest.xml in your platforms directory. With current cordova/phonegap version, this should not be necessary anymore (you can ignore platforms from version control!).

    改为设置:

    <preference name="android-minSdkVersion" value="14" />
    

    所有可能的配置都可以在这里: http://docs.build.phonegap.com/en_US/2.9.0/configuring_basics.md.html (文档说,它的工作原理对于phonegap构建,但它的工作原理相同cordova / phonegap cli!)。

    All possible configs are available here: http://docs.build.phonegap.com/en_US/2.9.0/configuring_basics.md.html (the document says, it works for phonegap build, but it works the same for cordova/phonegap cli!).

    这篇关于如何在PhoneGap中指定Android API级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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