公司ERP也开始步入手机领域了。配置cordova发现一些奇奇怪怪不能编译,不能启动的异常,这类问题一般问题原因不是程序的问题,而是环境配置的问题。 老规矩:
1)首先检查是不是少包
2)检查各个工具是不是使用同一个版本的java JDK。一是版本号,二是都是x86还是x64,这个也是需要注意的
3)检查编译的的目标版本是否一至
[dex] input: D:\vsworkspace\whatsvape\platforms\android\ant-build\classes
[dex] input: D:\vsworkspace\whatsvape\platforms\android\CordovaLib\ant-bui
ld\classes.jar
[dex] Pre-Dexing D:\vsworkspace\whatsvape\platforms\android\CordovaLib\ant
-build\classes.jar -> classes-a5a6808b08ed5a81eb057fbbacde9018.jar
[dx] Error occurred during initialization of VM
[dx] Could not reserve enough space for object heap
[dx] Error: Could not create the Java Virtual Machine.
[dx] Error: A fatal exception has occurred. Program will exit.
................
D:\vsworkspace\whatsvape\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "ant debug -f D:\vsworkspace\what
svape\platforms\android\build.xml -Dout.dir=ant-build -Dgen.absolute.dir=ant-gen
"
ERROR building one of the platforms: Error: D:\vsworkspace\whatsvape\platforms\a
ndroid\cordova\build.bat: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: D:\vsworkspace\whatsvape\platforms\android\cordova\build.bat: Command fai
led with exit code 8
at ChildProcess.whenDone (C:\Users\Administrator\AppData\Roaming\npm\node_mo
dules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131: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)