我正在使用Visual Studio 2013中的多设备混合应用程序使用Cordova开发移动应用程序, 在Debug配置上一切正常,应用程序将正确编译并安装在设备上。但是当我尝试通过Release或Distribution配置进行编译和部署时,它会给我这个错误
Error code 1 for command: cmd with args: /s,/c,ant,release,-f,d:\PhoneGap\projects\MyWeddingCard\MyWeddingCard\bld\Distribution\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
1> Command finished with error code 2: d:\phonegap\projects\MyWeddingCard\MyWeddingCard\bld\Distribution\platforms\android\cordova\build.bat --release,
1>
1> C:\Users\RezaRa\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:126
1> throw e;
1> ^
1>EXEC : error : d:\phonegap\projects\MyWeddingCard\MyWeddingCard\bld\Distribution\platforms\android\cordova\build.bat: Command failed with exit code 2
1> at ChildProcess.whenDone (C:\Users\RezaRa\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
1> at ChildProcess.emit (events.js:98:17)
1> at maybeClose (child_process.js:756:16)
1> at Process.ChildProcess._handle.onexit (child_process.js:823:5)
我知道这是一个普遍的错误,但有什么方法可以解决问题。
p.s我创建了Keystore文件并添加到ant.properties文件中。
答案 0 :(得分:6)
我发现问题是我从
更改了ant属性中的密钥库文件路径 key.store=D:\PhoneGap\projects\MyWeddingCard\Key\MyWeddingCardKeystore.keystore
到
key.store=D:\\PhoneGap\\projects\\MyWeddingCard\\Key\\MyWeddingCardKeystore.keystore