1

我正在使用带有 Cordova 工具的 Visual 2015 Preview,能够在调试模式下构建、部署应用程序到设备或 VS Android 模拟器,而不会出现任何问题。我遇到的麻烦是,当我在发布模式下执行它时,每当我尝试在发布模式下构建应用程序时,我都会收到以下错误 AppPath...\bld\Release\platforms\android\cordova\build.bat: Command failed with exit code 8模式

在调试模式下,它工作得非常好。

我也将所有环境变量设置如下

  1. ADT_HOME - C:\Program Files (x86)\Android\android-sdk
  2. ANT_HOME - C:\Program Files (x86)\Microsoft Visual Studio 14.0\Apps\apache-ant-1.9.3
  3. JAVA_HOME - C:\Program Files (x86)\Java\jdk1.7.0_55
  4. 路径变量已附加%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 ==========
4

3 回答 3

4

结果是非常小的问题,我已经迁移到新的开发环境,我有 ant.properties 文件,其中有这个键 == > key.store 指向与密钥存储关联的文件路径,路径中有小错字当我根据新环境更改它时。VS Studio 显示上述错误,我必须将构建详细程度增加到诊断以向我显示详细错误,一旦我将构建日志详细程度启用诊断,我就能够看到详细错误。

你可以在这里增加详细程度工具>选项...>项目和解决方案>构建和运行

于 2015-02-07T20:38:21.100 回答
0

试试这个删除这个目录

\bld\发布\平台

于 2015-03-31T22:51:24.947 回答
0

对我来说,事实上我将 ID 从 io.cordova.test 更改为一个名称,即 bob。我需要将其更改为 com.company.appname 格式。一旦我这样做了,它就起作用了。

我必须将 @Amol Gote 的评论归功于他关于启用详细构建评论的评论,否则我不会看到这一点。

于 2015-07-19T09:32:39.713 回答