当我要构建android应用程序时,Cordova引发错误

时间:2014-07-25 18:54:35

标签: android cordova

我是PhoneGap Cordova的新手,我将构建第一个应用程序。

我安装了Apache Ant,android SDK 19,Cordova 3.5.0

但是当我构建它时会引发错误:

C:\Users\Mehdi\hello>cordova build
Running command: C:\Users\Mehdi\hello\platforms\android\cordova\build.bat
Buildfile: C:\Users\Mehdi\hello\platforms\android\build.xml

-set-mode-check:

-set-debug-files:

-set-debug-mode:

-debug-obfuscation-check:

-setup:
     [echo] Creating output directories if needed...
     [echo] Gathering info for HelloWorld...
    [setup] Android SDK Tools Revision 18
    [setup] Project Target: Android 4.4
    [setup] API level: 19
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] C:\Users\Mehdi\hello\platforms\android: CordovaLib => C:\Users\Mehdi
\hello\platforms\android\CordovaLib
    [setup] ------------------
    [setup] Ordered libraries:
    [setup] C:\Users\Mehdi\hello\platforms\android\CordovaLib
    [setup]
    [setup] ------------------

-build-setup:
     [echo] Building Libraries

nodeps:

-set-mode-check:

-set-debug-files:

-set-debug-mode:

-debug-obfuscation-check:

-setup:
     [echo] Creating output directories if needed...
     [echo] Gathering info for CordovaLib...
    [setup] Android SDK Tools Revision 18
    [setup] Project Target: Android 4.4
    [setup] API level: 19
    [setup] Project Type: Android Library
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------

-build-setup:

-pre-build:

-code-gen:
     [echo] ----------
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found new input file
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:

-compile:
     [echo] Creating library output jar file...

-post-compile:

-obfuscate:

-dex:
     [echo] Library project: do not convert bytecode...

-crunch:
   [crunch] Crunching PNG Files in source dir: C:\Users\Mehdi\hello\platforms\an
droid\CordovaLib\res
   [crunch] To destination dir: C:\Users\Mehdi\hello\platforms\android\CordovaLi
b\ant-build\res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [echo] Library project: do not package resources...

-package:
     [echo] Library project: do not package apk...

-post-package:

-do-debug:
     [echo] Library project: do not create apk...
[propertyfile] Updating property file: C:\Users\Mehdi\hello\platforms\android\Co
rdovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Mehdi\hello\platforms\android\Co
rdovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Mehdi\hello\platforms\android\Co
rdovaLib\ant-build\build.prop
[propertyfile] Updating property file: C:\Users\Mehdi\hello\platforms\android\Co
rdovaLib\ant-build\build.prop

-post-build:

debug:
     [echo]
     [echo] ############################################
     [echo] **** Back to project HelloWorld ****
     [echo] ############################################

-pre-build:

-code-gen:
     [echo] ----------
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

BUILD FAILED
C:\Users\Mehdi\hello\platforms\android\custom_rules.xml:5: Reference project.all
.jars.path not found.

Total time: 4 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\Mehdi\hello
\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\Users\Mehdi\hello\platforms\android\cordova\build.bat: Command failed
with exit code 2
    at ChildProcess.whenDone (C:\Users\Mehdi\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)

如何构建应用程序?

0 个答案:

没有答案