Cordova 3.5 build Android在mac上使用命令行获取错误

时间:2014-08-28 14:09:33

标签: android cordova

我第一次使用cordova 3.5,尝试用它构建android apk,但在构建apk包时得到以下错误如下所示得到错误,无法找到哪里出错,任何人都可以告诉我哪里出错了?谢谢。      - 预编译:      [echo]将jars路径设置为:/ Users / zinch-cn / Project / SchoolLibrary / platforms / android / CordovaLib / ant-build / classes.jar

-compile:
[javac] Compiling 6 source files to /Users/zinch-cn/Project/SchoolLibrary/platforms/android/ant-build/classes
[javac] /Users/zinch-cn/Project/SchoolLibrary/platforms/android/src/com/zinch/SchoolLibrary/.java:25: <identifier> expected
[javac] public class  extends CordovaActivity
[javac]             ^
[javac] 1 error

BUILD FAILED
/usr/local/Cellar/android-sdk/23.0.2/tools/ant/build.xml:720: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/23.0.2/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 4 seconds

/Users/zinch-cn/Project/SchoolLibrary/platforms/android/cordova/node_modules/q/q.js:126
                throw e;
                      ^
Error code 1 for command: ant with args: debug,-f,/Users/zinch-cn/Project/SchoolLibrary/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/zinch-cn/Project/SchoolLibrary/platforms/android/cordova/run: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)

1 个答案:

答案 0 :(得分:1)

以下是使用cordova创建新项目的示例错误,

cordova create abc com.example.abc ABC

abc与com.example.abc相同,如果项目创建没有错误,当你构建应用程序时会显示如上所述的奇怪错误。希望这可以帮助别人。