【问题标题】:Giving error while running code for windows emulator WGA 512MB运行 Windows 模拟器 WGA 512MB 的代码时出错
【发布时间】:2014-11-11 00:56:36
【问题描述】:

我正在 Visual Studio 2013 的多设备混合应用程序中尝试一个简单的 index.html 文件。我可以轻松地在 android 模拟器上运行它。但是,在windows平台上运行却遇到了如下错误。

cordova library for "wp8" already exists. No need to download. Continuing.
  Generating config.xml from defaults for platform "wp8"
  Calling plugman.prepare for platform "wp8"
  Running command: C:\temp\projects\BlankCordovaApp1\BlankCordovaApp1\bld\Debug\platforms\wp8\cordova\run.bat --nobuild --emulator
  Deploying to emulator ...
  ERROR: command failed in deploy.js : "C:\temp\projects\BlankCordovaApp1\BlankCordovaApp1\bld\Debug\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\bin\Debug\CordovaDeploy.exe" "C:\temp\projects\BlankCordovaApp1\BlankCordovaApp1\bld\Debug\platforms\wp8" -d:1
Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
at CordovaDeploy.DeployTool.GetDeviceAtIndex(Int32 index) in c:\temp\projects\BlankCordovaApp1\BlankCordovaApp1\bld\Debug\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\Program.cs:line 124
at CordovaDeploy.DeployTool.Main(String[] args) in c:\temp\projects\BlankCordovaApp1\BlankCordovaApp1\bld\Debug\platforms\wp8\cordova\lib\CordovaDeploy\CordovaDeploy\Program.cs:line 208
  Command finished with error code 2: C:\temp\projects\BlankCordovaApp1\BlankCordovaApp1\bld\Debug\platforms\wp8\cordova\run.bat --nobuild,--emulator

有趣的是,它还创造了一个新的解决方案

C:\temp\projects\BlankCordovaApp1\BlankCordovaApp1\bld\Debug\platforms\wp8

文件夹,如果我打开该解决方案,编译并运行它,它就可以在 windows phone 8.1 模拟器上正常工作。任何想法我做错了什么?我相信我已经在 Visual Studio 2013 中正确设置了路径!

【问题讨论】:

    标签: visual-studio-2013 windows-phone-8.1 multi-device-hybrid-apps


    【解决方案1】:

    查看错误消息,似乎程序根本找不到任何适用于 WP8 的模拟器。 CPT2.0 使用 CordovaDeploy.exe 来获取可用的 WP8 模拟器/设备列表,这是有问题的。似乎此问题已在最新版本的 Visual Studio Tools for Apache Cordova -- CPT3.0 中得到修复。按照以下步骤安装CPT3.0

    1. 卸载 Visual Studio Apache Cordova 多设备混合应用 CPT2.0
    2. 从here 安装 Visual Update 4
    3. 从here 安装 CPT 3.0
    4. 卸载问题请参阅此http://support.microsoft.com/kb/3014133

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-12-15
      • 2021-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-31
      • 1970-01-01
      相关资源
      最近更新 更多