我正在使用带有 Cordova 工具的 Visual 2015 Preview,能够在调试模式下构建、部署应用程序到设备或 VS Android 模拟器,而不会出现任何问题。我遇到的麻烦是,当我在发布模式下执行它时,每当我尝试在发布模式下构建应用程序时,我都会收到以下错误 AppPath...\bld\Release\platforms\android\cordova\build.bat: Command failed with exit code 8模式
在调试模式下,它工作得非常好。
我也将所有环境变量设置如下
- ADT_HOME - C:\Program Files (x86)\Android\android-sdk
- ANT_HOME - C:\Program Files (x86)\Microsoft Visual Studio 14.0\Apps\apache-ant-1.9.3
- JAVA_HOME - C:\Program Files (x86)\Java\jdk1.7.0_55
- 路径变量已附加%JAVA_HOME%\bin;%ADT_HOME%\tools;%ADT_HOME%\platform-tools;%ANT_HOME%\bin;
除了设置环境变量外,所有这些安装都是默认 Visual Studio 安装的一部分。
请让我知道在发布模式下需要做些什么来解决这个问题。
我已经使用带有 Cordova 工具的 VS 2015 预览版在应用商店中发布了我的应用程序,我不得不重建我的开发人员机器/笔记本电脑,这就是所有这些麻烦开始的时候。我需要在本周末发布对我的应用程序的更新,但我现在卡住了。
下面是发布模式的构建输出
1>------ Build started: Project: PackagedInterviewApp, Configuration: Release Android ------
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(96,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.
1> GeneratedJavascript=
1> C:\TFS Application Path....>call "C:\Program Files (x86)\nodejs\"\nodevars.bat `enter code here`
1> Your environment has been set up for using Node.js 0.10.33 (ia32) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\nxqc2vi5.kqy\packages\vs-mda
1>MDAVSCLI : error : C:\TFS Application Path....\bld\Release\platforms\android\cordova\build.bat: Command failed with exit code 8
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
下面是针对设备或 VS Android 模拟器的调试模式的构建输出
1>------ Build started: Project: PackagedInterviewApp, Configuration: Debug Android ------
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(96,5): warning : The TypeScript Compiler was given no files for compilation, so it will skip compiling.
1> GeneratedJavascript=
1> C:\TFS App Path...>call "C:\Program Files (x86)\nodejs\"\nodevars.bat
1> Your environment has been set up for using Node.js 0.10.33 (ia32) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\nxqc2vi5.kqy\packages\vs-mda
2>------ Deploy started: Project: PackagedInterviewApp, Configuration: Debug Android ------
2>Starting launch process C:\Program Files (x86)\nodejs\node.exe ""C:\Users\....\AppData\Roaming\npm\node_modules\vs-mda\emulator.js"" --platform android --path "C:\TFS App Path...\bld\Debug" --deployTarget "target=169.254.220.177:5555" --language en-US --configuration debug
2> Generating config.xml from defaults for platform "android"
2> Calling plugman.prepare for platform "android"
2> Preparing android project
2> Processing configuration changes for plugins.
2> Iterating over installed plugins: []
2> Writing out cordova_plugins.js...
2> Wrote out Android application name to "Demo App"
2> This app does not have launcher icons defined
2> Wrote out Android package name to "io.cordova.myapp5fd4c4873c4d44e3a8d208242fbad585"
2> Running command: C:\TFS App Path...\bld\Debug\platforms\android\cordova\run.bat --nobuild --target=169.254.220.177:5555 --debug
2> Skipping build...
2> Built the following apk(s):
2> C:\TFS App Path...\bld\Debug\platforms\android\ant-build\CordovaApp-debug.apk
2> Using apk: C:\TFS App Path...\bld\Debug\platforms\android\ant-build\CordovaApp-debug.apk
2> Installing app on device...
2> Launching application...
2> LAUNCH SUCCESS
2> Command finished with error code 0: C:\TFS App Path...\bld\Debug\platforms\android\cordova\run.bat --nobuild,--target=169.254.220.177:5555,--debug
2>
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========