1

我使用 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

将不胜感激。

4

2 回答 2

1

在你可以运行你的 android 应用程序之前,你需要使用命令:cordova build

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

于 2013-09-11T16:39:00.420 回答
0

Follow this steps:

phonegap run android in terminal
strong text[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...

if you already installed Andorid SDK then automatically emulator run. Ok then you check your local disk where you stored your phongegap project -> and goto Platform ->android ->ant-Build: there .apk File generated.

于 2014-11-10T11:02:30.037 回答