我在使用
构建sencha应用程序时遇到此错误sencha app build production
C:wampwwwactivLearn2.senchaappresources-impl.xml:7: java.lang.IllegalArgum
entException: Negative time
应用程序在localhost (localhost/activLearn2)中工作正常,但在构建时抛出此错误。错误发生在最后几行。
Sencha Cmd v4.0.4.84
[INF]
[INF] init-plugin:
[INF]
[INF] cmd-root-plugin.init-properties:
[INF]
[INF] init-properties:
[INF]
[INF] init-sencha-command:
[INF]
[INF] init:
[INF]
[INF] app-build-impl:
[INF]
[INF] -before-init-local:
[INF]
[INF] -init-local:
[INF]
[INF] -after-init-local:
[INF]
[INF] init-local:
[INF]
[INF] find-cmd-in-path:
[INF]
[INF] find-cmd-in-environment:
[INF]
[INF] find-cmd-in-shell:
[INF]
[INF] init-cmd:
[INF] [echo] Using Sencha Cmd from C:UsersRahulbinSenchaCmd4.0.4.84 f
or C:wampwwwactivLearn2build.xml
[INF]
[INF] -before-init:
[INF]
[INF] -init:
[INF] Initializing Sencha Cmd ant environment
[INF] Adding antlib taskdef for com/sencha/command/compass/ant/antlib.xml
[INF]
[INF] -after-init:
[INF]
[INF] -before-init-defaults:
[INF]
[INF] -init-defaults:
[INF]
[INF] -after-init-defaults:
[INF]
[INF] -init-compiler:
[INF]
[INF] init:
[INF]
[INF] -before-build:
[INF]
[INF] refresh:
[INF]
[INF] -before-refresh:
[INF]
[INF] -init:
[INF]
[INF] -init-compiler:
[INF]
[INF] -detect-app-build-properties:
[INF] Loading app json manifest...
[INF] Loading classpath entry C:wampwwwactivLearn2touchsrc
[INF] Loading classpath entry C:wampwwwactivLearn2app.js
[INF] Loading classpath entry C:wampwwwactivLearn2app
[INF] Loading classpath entry C:wampwwwactivLearn2buildtempproductionacti
vLearn2sencha-compilerapp
[WRN] C1000: Rhino Parse Warning (Trailing comma is not legal in an ECMA-262 obj
ect initializer => },) -- C:wampwwwactivLearn2appcontrolle
rMain.js:13:11
[INF] Loading classpath entry C:wampwwwactivLearn2buildtempproductionacti
vLearn2sencha-compilerapp
[INF] Concatenating output to file C:wampwwwactivLearn2/build/temp/production
/activLearn2/sencha-compiler/cmd-packages.js
[INF] Adding external reference : @full-page => @overrides
[INF] Loading classpath entry C:wampwwwactivLearn2buildtempproductionacti
vLearn2sencha-compilercmd-packages.js
[INF] Adding external reference : Ext.util.Observable => C:wampwwwactivLearn2
/build/temp/production/activLearn2/sencha-compiler/cmd-packages.js
[INF]
[INF] -refresh-app:
[INF] Appending concatenated output to file C:wampwwwactivLearn2/bootstrap.js
[INF] Appending concatenated output to file C:wampwwwactivLearn2/bootstrap.js
[INF] Appending concatenated output to file C:wampwwwactivLearn2/bootstrap.js
[INF] Appending concatenated output to file C:wampwwwactivLearn2/bootstrap.js
[INF] Appending concatenated output to file C:wampwwwactivLearn2/bootstrap.js
[INF] Appending content to C:wampwwwactivLearn2/bootstrap.json
[INF]
[INF] -refresh:
[INF]
[INF] -after-refresh:
[INF]
[INF] resolve:
[INF]
[INF] js:
[INF]
[INF] -before-js:
[INF]
[INF] -init:
[INF]
[INF] -init-compiler:
[INF]
[INF] -detect-app-build-properties:
[INF]
[INF] -compile-js:
[INF] Concatenating output to file C:wampwwwactivLearn2/build/production/acti
vLearn2/app.js
[INF]
[INF] -js:
[INF]
[INF] -after-js:
[INF]
[INF] resources:
[INF]
[INF] -before-resources:
[INF]
[INF] -before-inherit-resources:
[INF]
[INF] -before-copy-resources:
[INF]
[INF] -init:
[INF]
[INF] -init-compiler:
[INF]
[INF] -resources:
[INF] merging resources into C:wampwwwactivLearn2buildproductionactivLearn
2resources
[INF] merged 0 resources into C:wampwwwactivLearn2buildproductionactivLear
n2resources
[INF] merging resources into C:wampwwwactivLearn2buildproductionactivLearn
2
[ERR]
[ERR] BUILD FAILED
[ERR] java.lang.IllegalArgumentException: Negative time
[ERR]
[ERR] Total time: 4 seconds
[ERR] The following error occurred while executing this line:
C:wampwwwactivLearn2.senchaappbuild-impl.xml:291: The following error occu
rred while executing this line:
C:wampwwwactivLearn2.senchaappresources-impl.xml:7: java.lang.IllegalArgum
entException: Negative time
我也检查了一个。sencha/app/build-impl.xml:291,也就是这个
<x-ant-call unless="skip.resources">
<target name="-before-resources"/>
第七行是注释
<!--
********************************** DO NOT EDIT **********************************
This file will be replaced during upgrades so DO NOT EDIT this file. If you need to
adjust the process, reading and understanding this file is the first step.
如何解决?
导致问题的原因是我在资源/图标文件夹中包含字体文件(Lato.ttf)。这就是它给出负时间误差的原因。把它们放在一个单独的字体文件夹中解决了这个问题