Phonegap CLI不会创建.apk文件

时间:2013-09-11 11:55:52

标签: android cordova command-line-interface

我使用PhoneGap的CLI创建了一个示例项目,但无法在Android上运行它。 未生成apk文件。我安装了Android,Java和ant,并设置了所有必要的路径。

任何想法有什么不对?
以下是控制台的输出:

phonegap local run -V android
[phonegap] compiling Android...
[phonegap] cordova library for "android" already exists. No need to download. Continuing.
[phonegap] Wrote out Android application name to "PGlol"
[phonegap] Wrote out Android package name to "pl.gda.pg29lol"
[phonegap] Calling plugman.prepare for platform "android"
[phonegap] Compiling platform "android" with command "F:\phonegap_projects\pg29lol\platforms\android\cordova\build"" (output to follow)...
[phonegap] Cleaning project...
WARNING: [ --debug | --release | --nobuild ] not specified, defaulting to --debug.
Buildfile: F:\phonegap_projects\pg29lol\platforms\android\build.xml
-set-mode-check:
[phonegap] Platform "android" compiled successfully.
[phonegap] successfully compiled Android app
[phonegap] trying to install app onto device
[phonegap] cordova library for "android" already exists. No need to download. Continuing.
[phonegap] Wrote out Android application name to "PGlol"
[phonegap] Wrote out Android package name to "pl.gda.pg29lol"
[phonegap] Calling plugman.prepare for platform "android"
[phonegap] Running app on platform "android" with command" "F:\phonegap_projects\pg29lol\platforms\android\cordova\run" --device" (output to follow)...
[phonegap] Cleaning project...
WARNING: [ --debug | --release | --nobuild ] not specified, defaulting to --debug.
Buildfile: F:\phonegap_projects\pg29lol\platforms\android\build.xml


-set-mode-check:

无法找到apk,请确保您的项目已构建且\ bin中有apk。要构建项目,请使用'\ cordova \ build'

[phonegap] Platform "android" ran successfully.
[phonegap] successfully installed onto device

非常感谢您的帮助。

2 个答案:

答案 0 :(得分:1)

在运行Android应用程序之前,您需要使用命令:cordova build

这将构建apk,“phonegap local run -V android”将运行

答案 1 :(得分:0)

请按照以下步骤操作:

phonegap在终端中运行android 强文 [phonegap]检测Android SDK环境...
[phonegap]使用当地环境
[phonegap]正在编译Android ...

如果您已经安装了Andorid SDK,那么自动运行模拟器。 好的,然后检查存储phongegap项目的本地磁盘 - >并转到平台 - > android - > ant-Build:有.apk生成的文件。