为了获得 cordova.2.xxjar 文件,您只需执行以下步骤:
从 Phonegap 网站下载该项目。对于 2.9.1 版,请点击此链接: http: //phonegap.com/install/并导航到您要查找的版本 (2.9.1),它将链接到https://github.com/phonegap/phonegap/archive /2.9.1.zip
下载并解压后,进入framework
目录phonegap-2.9.1/lib/android/framework
您必须选择要使用的 android 版本,如果您已下载 Android SDK 并添加到系统的路径变量(如果您还没有查看下面)你可以这样做:
android list targets
(如果您的系统路径中还没有 SDK,则需要在 SDK 文件夹中添加两个目录工具和平台工具。尝试 previos 命令和...)
It will give you an answer like this one:
Available Android targets:
----------
id: 1 or "android-8"
Name: Android 2.2
Type: Platform
API level: 8
Revision: 3
Skins: WQVGA432, QVGA, WQVGA400, WVGA854, WVGA800 (default), HVGA
ABIs : armeabi
----------
id: 2 or "android-17"
Name: Android 4.2.2
Type: Platform
API level: 17
Revision: 2
Skins: WXGA720, WXGA800-7in, WQVGA432, WSVGA, QVGA, WQVGA400, WXGA800, WVGA854, WVGA800 (default), HVGA
ABIs : armeabi-v7a, x86
----------
id: 3 or "Google Inc.:Google APIs:17"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 3
Description: Android + Google APIs
Based on Android 4.2.2 (API level 17)
Libraries:
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA800 (default), QVGA, WXGA800
ABIs : armeabi-v7a
----------
id: 4 or "android-19"
Name: Android 4.4
Type: Platform
API level: 19
Revision: 1
Skins: WXGA720, WXGA800-7in, WQVGA432, WSVGA, QVGA, WQVGA400, WXGA800, WVGA854, WVGA800 (default), HVGA
ABIs : armeabi-v7a
我选择了最后一个,所以我做了:
android update project -p . -t android-19
最后
ant jar
结果是这样的:
[jar] Building jar: /home/jgonzalezd/Downloads/phonegap-2.9.1/lib/android/framework/cordova-2.9.1.jar
BUILD SUCCESSFUL
Total time: 10 seconds
现在你有了你的罐子。