Visual Studio 2015 RTM Cordova 项目不会调试/部署到 Android、Windows、Windows Phone [英] Visual Studio 2015 RTM Cordova project won't debug/deploy to Android, Windows, Windows Phone

查看:23
本文介绍了Visual Studio 2015 RTM Cordova 项目不会调试/部署到 Android、Windows、Windows Phone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种感觉,我太早升级到 Visual Studio 2015 RTM.Visual Studio Emulator for Android 将不再启动,声称预发布版本已过期.

I've got a feeling I upgraded to Visual Studio 2015 RTM too early. Visual Studio Emulator for Android would no longer launch, claiming that the pre-release version had expired.

我运行了 RTM 安装程序,允许它根据需要替换发布候选组件.过程运行顺利,但现在升级后,Cordova 项目将不再部署或调试.

I ran the RTM installer, allowing it to replace Release Candidate components as needed. The process ran smoothly, but now after upgrading, Cordova projects will no longer deploy or debug.

对于候选版本,工具栏的绿色开始按钮有一个用于选择设备的下拉菜单.现在使用 RTM 版本,此按钮仅标记为开始",其下拉列表不提供设备选择选项.相反,下拉列表中的唯一选项是开始".当我更改位于此开始"按钮左侧的解决方案平台"下拉列表中的选择时,开始"按钮仍然没有提供任何选择.见下图.

With the Release Candidate, the toolbar's green Start button had a dropdown for choice of device. Now with RTM version, this button is just labelled "Start" and its dropdown provides no options for device selection. Instead, the only option in the dropdown is "Start". As I change the selection in the "Solution Platform" dropdown, located left of this Start button, the Start button still provides no choices. See images below.

解决平台:Android

Solution Platform: Android

解决方案平台:Windows-AnyCPU

Solution Platform: Windows-AnyCPU

解决方案平台:Windows Phone 8

Solution Platform: Windows Phone 8

调试菜单的开始调试"项被禁用.如果单击开始"工具栏按钮,则会收到以下消息:调试器无法继续运行该进程.无法开始调试."

The Debug menu's "Start Debugging" item is disabled. If I click the Start toolbar button, I get this message: "The debugger cannot continue running the process. Unable to start debugging."

我已确认适用于 Android 的 Visual Studio 模拟器可以正常工作.我的配置文件5" Lollipop (5.0) XXHDPI Phone"可以正常工作.

I've confirmed that Visual Studio Emulator for Android is functional. I've got the profile '5" Lollipop (5.0) XXHDPI Phone' working.

为了进行比较,我还在我的解决方案中添加了一个新的 Windows Phone 8.1 项目,并确认该项目允许选择调试目标.在工具栏中,开始"一词被替换为Emulator 8.1 WVGA 4 inch 512MB".将此项目作为启动项目,调试菜单现在启用了开始调试".此项目按预期启动.

For a comparison, I've also added a new Windows Phone 8.1 project to my solution and confirmed that project allows selecting a Debug Target. In the toolbar, the word Start is replaced with "Emulator 8.1 WVGA 4 inch 512MB". With this project as the Startup Project, the Debug menu now has "Start Debugging" enabled. This project starts as expected.

由于适用于 Android 的 Visual Studio 模拟器功能正常,并且 Visual Studio 成功地面向 Windows Phone 模拟器,因此似乎存在与 Visual Studio 的 Cordova 项目类型相关的错误配置.缺少 VS2015 Cordova 项目与其设备"目标之间的联系.

Since the Visual Studio Emulator for Android is functional, and Visual Studio successfully targets the Windows Phone emulator, it seems there's a misconfiguration related to Visual Studio's Cordova project type. The linkage between a VS2015 Cordova project and its "device" targets is missing.

有什么想法吗?

更新:另见:无法在 Visual Studio RTM 中为cordova 应用程序启动调试

更新 2:我做了一些调整:

  1. Apache Cordova 的依赖项检查器工具发现缺少 Android SDK 组件.我已经添加了这些,满足依赖检查器.

  1. Tools for Apache Cordova's Dependency checker found missing Android SDK components. I've added these, satisfying Dependency Checker.

Apache Cordova 的环境变量覆盖工具未显示 ADT_HOME 的路径.我已将其设置为C:Program Files (x86)Androidandroid-sdk".

Tools for Apache Cordova's Environment Variable Overrides showed no path to ADT_HOME. I've set it to "C:Program Files (x86)Androidandroid-sdk".

我的构建输出显示[taskdef] 无法从资源 emma_ant.properties 加载定义.无法找到它."我添加了一个指向C:Program Files (x86)Microsoft Visual Studio 14.0Appsapache-ant-1.9.3"的系统环境变量ANT_HOME,并将;%ANT_HOME%in"添加到PATH.emma_ant.properties"消息仍然存在,但还没有达到警告或错误的级别.

My build output showed "[taskdef] could not load definitions from resource emma_ant.properties. it could not be found." I added a system environment variable ANT_HOME pointing to "C:Program Files (x86)Microsoft Visual Studio 14.0Appsapache-ant-1.9.3", and added ";%ANT_HOME%in" to the PATH. Still "emma_ant.properties" message remains, but it is not up to the level of a warning or error.

将解决方案平台设置为 Android,我当前的构建输出是:

With Solution Platform set to Android, my current build output is:

1>------ Rebuild All started: Project: BlankCordovaApp2, Configuration: Debug Android ------
1>  Buildfile: C:UsersillvoDocumentsVisual Studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroiduild.xml
1>    [taskdef] Could not load definitions from resource emma_ant.properties. It could not be found.
1>
1>  -check-env:
1>   [checkenv] Android SDK Tools Revision 23.0.0
1>   [checkenv] Installed at C:Program Files (x86)Androidandroid-sdk
1>
1>  -setup:
1>       [echo] Project Name: MainActivity
1>    [gettype] Project Type: Application
1>
1>  -pre-clean:
1>
1>  clean:
1>  [getlibpath] Library dependencies:
1>  [getlibpath]
1>  [getlibpath] ------------------
1>  [getlibpath] Ordered libraries:
1>    [taskdef] Could not load definitions from resource emma_ant.properties. It could not be found.
1>
1>  nodeps:
1>
1>  -check-env:
1>   [checkenv] Android SDK Tools Revision 23.0.0
1>   [checkenv] Installed at C:Program Files (x86)Androidandroid-sdk
1>
1>  -setup:
1>       [echo] Project Name: MainActivity
1>    [gettype] Project Type: Android Library
1>
1>  -pre-clean:
1>
1>  clean:
1>
1>  BUILD SUCCESSFUL
1>  Total time: 0 seconds
1>  Your environment has been set up for using Node.js 0.12.2 (ia32) and npm.
1>  ------ Ensuring correct global installation of package from source package directory: C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEExtensionsApacheCordovaToolspackagesvs-tac
1>  ------ Name from source package.json: vs-tac
1>  ------ Version from source package.json: 1.0.0
1>  ------ Package not currently installed globally.
1>  ------ Installing globally from source package. This could take a few minutes...
1>  > edge@0.10.1 install C:UsersillvoAppDataRoaming
pm
ode_modulesvs-tac
ode_modulesedge
1>  > node tools/install.js
1>  Success: platform check for edge.js: node.js ia32 v0.12.2
1>  npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.2","npm":"2.7.4"})
1>  npm WARN engine cordova-js@3.6.2: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"})
1>  npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn't found in unpacked tree
1>  C:UsersillvoAppDataRoaming
pmvs-tac-cli -> C:UsersillvoAppDataRoaming
pm
ode_modulesvs-tacvs-tac-cli.cmd
1>  vs-tac@1.0.0 C:UsersillvoAppDataRoaming
pm
ode_modulesvs-tac
1>  ├── rimraf@2.2.6
1>  ├── ncp@0.5.1
1>  ├── mkdirp@0.3.5
1>  ├── q@1.0.1
1>  ├── semver@2.3.1
1>  ├── adm-zip@0.4.4
1>  ├── fstream@0.1.28 (inherits@2.0.1, graceful-fs@3.0.8)
1>  ├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
1>  ├── tar@0.1.20 (inherits@2.0.1, block-stream@0.0.8)
1>  ├── elementtree@0.1.6 (sax@0.3.5)
1>  ├── request@2.36.0 (forever-agent@0.5.2, aws-sign2@0.5.0, qs@0.6.6, oauth-sign@0.3.0, tunnel-agent@0.4.1, json-stringify-safe@5.0.1, mime@1.2.11, node-uuid@1.4.3, tough-cookie@2.0.0, http-signature@0.10.1, hawk@1.0.0, form-data@0.1.4)
1>  ├── ripple-emulator@0.9.30 (connect-xcors@0.5.2, colors@0.6.0-1, open@0.0.3, accounting@0.4.1, request@2.12.0, moment@1.7.2, express@3.1.0)
1>  ├── edge@0.10.1 (edge-cs@0.2.7, nan@1.8.4)
1>  └── plugman@0.22.4 (q@0.9.7, underscore@1.4.4, nopt@1.0.10, rc@0.3.0, cordova-lib@0.21.6, npm@1.3.4)
1>  ------ npm install of vs-tac@1.0.0 from C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEExtensionsApacheCordovaToolspackagesvs-tac completed.
1>  ------ Installing Cordova tools cordova@4.3.1 for project from npm. This could take a few minutes...
1>  npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.2","npm":"2.7.4"})
1>  npm WARN engine cordova-js@3.8.0: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"})
1>  npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"})
1>  npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn't found in unpacked tree
1>  cordova@4.3.1 node_modulescordova
1>  ├── underscore@1.7.0
1>  ├── q@1.0.1
1>  ├── nopt@3.0.1 (abbrev@1.0.7)
1>  └── cordova-lib@4.3.1 (valid-identifier@0.0.1, osenv@0.1.0, properties-parser@0.2.3, bplist-parser@0.0.6, mime@1.2.11, unorm@1.3.3, semver@2.0.11, dep-graph@1.1.0, shelljs@0.3.0, rc@0.5.2, through2@0.6.3, npmconf@0.1.16, xcode@0.6.7, elementtree@0.1.5, d8@0.4.4, request@2.47.0, glob@4.0.6, tar@1.0.2, init-package-json@1.7.1, plist@1.1.0, cordova-js@3.8.0, npm@1.3.4)
1>  ------ npm install of cordova@4.3.1 from npm completed.
1>  ------ Build Settings:
1>  ------ Build Settings:
1>  ------    platformConfigurationBldDir: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2ldAndroidDebug
1>  ------    platformConfigurationBinDir: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2inAndroidDebug
1>  ------    buildCommand: prepare
1>  ------    platform: Android
1>  ------    cordovaPlatform: android
1>  ------    configuration: Debug
1>  ------    cordovaConfiguration: Debug
1>  ------    projectName: BlankCordovaApp2
1>  ------    projectSourceDir: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
1>  ------    npmInstallDir: C:UsersillvoAppDataRoaming
pm
1>  ------    language: en-US
1>  ------ Platform android already exists
1>  ------ Updating plugins
1>  ------ Currently installed plugins:
1>  ------ Currently installed dependent plugins:
1>  ------ Currently configured plugins:
1>  ------ Preparing platform: android
1>  Generating config.xml from defaults for platform "android"
1>  Calling plugman.prepare for platform "android"
1>  Preparing android project
1>  Processing configuration changes for plugins.
1>  Iterating over installed plugins: []
1>  Writing out cordova_plugins.js...
1>  Wrote out Android application name to "BlankCordovaApp2"
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-hdpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-ldpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-mdpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-xhdpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-hdpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-ldpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-mdpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-xhdpiscreen.png
1>  splash screens: [{"src":"res/screens/android/screen-hdpi-landscape.png","density":"land-hdpi","platform":"android"},{"src":"res/screens/android/screen-ldpi-landscape.png","density":"land-ldpi","platform":"android"},{"src":"res/screens/android/screen-mdpi-landscape.png","density":"land-mdpi","platform":"android"},{"src":"res/screens/android/screen-xhdpi-landscape.png","density":"land-xhdpi","platform":"android"},{"src":"res/screens/android/screen-hdpi-portrait.png","density":"port-hdpi","platform":"android"},{"src":"res/screens/android/screen-ldpi-portrait.png","density":"port-ldpi","platform":"android"},{"src":"res/screens/android/screen-mdpi-portrait.png","density":"port-mdpi","platform":"android"},{"src":"res/screens/android/screen-xhdpi-portrait.png","density":"port-xhdpi","platform":"android"}]
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-hdpi-landscape.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-hdpiscreen.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-ldpi-landscape.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-ldpiscreen.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-mdpi-landscape.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-mdpiscreen.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-xhdpi-landscape.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-land-xhdpiscreen.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-hdpi-portrait.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-hdpiscreen.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-ldpi-portrait.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-ldpiscreen.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-mdpi-portrait.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-mdpiscreen.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esscreensandroidscreen-xhdpi-portrait.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-port-xhdpiscreen.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-hdpiicon.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-ldpiicon.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-mdpiicon.png
1>  deleted: C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-xhdpiicon.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esiconsandroidicon-36-ldpi.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-ldpiicon.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esiconsandroidicon-48-mdpi.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-mdpiicon.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esiconsandroidicon-72-hdpi.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-hdpiicon.png
1>  copying image from C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2
esiconsandroidicon-96-xhdpi.png to C:Usersillvodocumentsvisual studio 2015ProjectsBlankCordovaApp2BlankCordovaApp2platformsandroid
esdrawable-xhdpiicon.png
1>  Wrote out Android package name to "io.cordova.myapp2a20d4"
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

无论我是为 Android、Windows-AnyCPU 还是 Windows Phone 8 构建,我仍然无法选择目标设备进行调试.

I'm still not able to select the target device for debugging, regardless of whether I build for Android, Windows-AnyCPU, or Windows Phone 8.

更新 3: 下图显示了安装的 Visual Studio 2015 组件.我尝试添加 Visual C++ Mobile Development,但在 Cordova 中没有看到任何变化,因此我将其删除.

UPDATE 3: The images below show the Visual Studio 2015 components installed. I tried adding Visual C++ Mobile Development, but saw no change in Cordova, so I removed it.

更新 4: 当我登录到新的本地用户帐户时,我能够针对适用于 Android 的 Visual Studio 模拟器进行调试.这告诉我问题可能特定于我的主要 Windows 帐户的配置文件.我可以通过删除我的个人资料并重新开始来解决这个问题.

UPDATE 4: When I logged into a new local user account, I'm able to debug against the Visual Studio Emulator for Android. This tells me that the problem is likely specific to my primary Windows account's profile. I could probably fix this by deleting my profile and starting fresh.

推荐答案

看起来库因升级而损坏.请试一试:

Looks like a library is corrupted from the upgrade. Please give this a try:

  1. 关闭所有VS实例
  2. cd %appdata%LocalMicrosoftPhone Tools"
  3. 重命名CoreCon文件夹
  4. 再次启动 VS.

如果这能解决您的问题,请告诉我们.感谢您使用 VS 2015 和 Apache Cordova 工具.

Let us know if this resolves your issue. Thanks for using VS 2015 and Tools for Apache Cordova.

浸泡.

这篇关于Visual Studio 2015 RTM Cordova 项目不会调试/部署到 Android、Windows、Windows Phone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆