简体   繁体   English

从 Visual Studio 2015 部署cordova 应用程序时出错

[英]Getting errors when deploying cordova app from visual studio 2015

I use Visual Studio 2015 with Cordova tools 5.4.1.我将 Visual Studio 2015 与 Cordova 工具 5.4.1 一起使用。
I have an issue while trying to debug my cordova application on android device (from Visual Studio 2015).尝试在 android 设备(来自 Visual Studio 2015)上调试我的cordova 应用程序时遇到问题。
The build is successfull but the deployment my device (Galaxy S4) fail just after the command : Querying ADB for attached devices...构建成功,但我的设备 (Galaxy S4) 的部署在命令之后失败:查询 ADB 以获取连接的设备...
I have activated Verbose log but i don't have enough details.我已激活详细日志,但我没有足够的详细信息。 Find below the bottom of the log stack:在日志堆栈底部找到以下内容:

1> 20 ms CreateBuildInfoMetadata 1 calls 1> 20 ms CreateBuildInfoMetadata 1 次调用
1> 772 ms RunMdaInstall 1 calls 1> 772 毫秒 RunMdaInstall 1 次调用
1> 774 ms CallTarget 1 calls 1> 774 ms CallTarget 1 次调用
1> 22118 ms MdaVsCli 1 calls 1> 22118 毫秒 MdaVsCli 1 次调用
1> 1>
1>Build succeeded. 1>构建成功。
1> 1>
1>Time Elapsed 00:00:22.94 1> 时间流逝 00:00:22.94
2>------ Deploy started: Project: Amiability, Configuration: Debug Android ------ 2>------ 部署开始:项目:Amiability,配置:调试Android------
2> Querying ADB for attached devices... 2> 查询 ADB 连接的设备...
2>Le fichier spécifié est introuvable 2>Le fichier spécifié est introuvable
2>Le fichier spécifié est introuvable 2>Le fichier spécifié est introuvable
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== 构建:1 成功,0 失败,0 最新,0 跳过 ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ========== ========== 部署:0 成功,1 失败,0 跳过 ==========

NB: "Le fichier spécifié est introuvable" means "The specified file cannot be found".注意:“Le fichier spécifié est introuvable”的意思是“找不到指定的文件”。

Do you know what's is the problem ?你知道是什么问题吗? How can i get more details about the missing files ?如何获得有关丢失文件的更多详细信息?

I have reinstalled the android SDK , and everything works well now.我已经重新安装了 android SDK ,现在一切正常。 It's seems sometimes some files get corrupted in the SDK.有时,SDK 中的某些文件似乎已损坏。 If i get the same issue again, i will try to know which file or folder is corrupted by cleaning the SDK folders step by step.如果我再次遇到同样的问题,我将通过逐步清理 SDK 文件夹来尝试知道哪个文件或文件夹已损坏。

Many thanks to you :)非常感谢你:)

I faced more or less the same problem with the latest Cordova CLI release version.我在使用最新的 Cordova CLI 发行版时或多或少遇到了同样的问题。

The short answer for you is: Cordova 5.4.1 is not yet fully supported in VS 2015. I was suggested to use Cordova 5.3.3 for now until guys from TACO team will add full support for the latest release of CLI.简短的回答是:VS 2015 尚未完全支持 Cordova 5.4.1。有人建议我暂时使用 Cordova 5.3.3,直到 TACO 团队的人员将全面支持最新版本的 CLI。 Please see here for full explanation 请参阅此处以获取完整说明

PS Cordova 5.3.3 is OK to my needs. PS Cordova 5.3.3 可以满足我的需求。 =) =)

I was having this exact issue until I started VS2015 as an Administrator.在我以管理员身份启动 VS2015 之前,我遇到了这个确切的问题。 Reran and it seemed to fix the issue. Reran,它似乎解决了这个问题。

I encountered this problem when my PATH environment variable had grown to exceed 1024 characters, and the path to the android SDK was not in the path, with the result that adb.exe could not be found.当我的PATH环境变量增长到超过1024个字符时,我遇到了这个问题,并且路径中没有android SDK的路径,导致adb.exe If you run adb devices in a terminal, you should see your attached device.如果您在终端中运行adb devices ,您应该会看到您连接的设备。 If you see 'adb' is not recognized as an internal or external command, then you may have the same problem that I had.如果您看到“adb”未被识别为内部或外部命令,那么您可能遇到了与我相同的问题。

If that's the case, reduce the length of the PATH variable and include the path to the android SDK.如果是这种情况,请减少 PATH 变量的长度并包含 android SDK 的路径。

This question gives suggestions on reducing the length of the PATH variable. 这个问题给出了减少 PATH 变量长度的建议。

In my case the path that needed to be included in the PATH variable was "C:\\Program Files (x86)\\Android\\android-sdk\\platform-tools"在我的情况下,需要包含在 PATH 变量中的路径是“C:\\Program Files (x86)\\Android\\android-sdk\\platform-tools”

You can edit the PATH variable in Control Panel -> System and Security -> System -> Advanced system settings -> Advanced tab -> Environment Variables.您可以在控制面板 -> 系统和安全 -> 系统 -> 高级系统设置 -> 高级选项卡 -> 环境变量中编辑 PATH 变量。

I reinstalled JDK, Android SDK, Android NDK, updated the repaired my installation of all components of Visual Studio, updated the paths to SDK, NDK, and JDK in Tools --> Android SDK Manager --> and in Tools --> Options --> Xamarin --> Android Settings, and then cleared the Cordova Cache.我重新安装了 JDK、Android SDK、Android NDK,更新了我对 Visual Studio 的所有组件的修复安装,在Tools --> Android SDK Manager --> 和 Tools --> Options 中更新了 SDK、NDK 和 JDK 的路径--> Xamarin --> Android 设置,然后清除 Cordova 缓存。

To clear the Cordova Cache: tools-->options-->tools for apache cordova--> clear cordova cache .要清除 Cordova 缓存: tools-->options-->tools for apache cordova--> clear cordova cache 清除cordova缓存

Finally, I uninstalled JDK 1.7, and voila!最后,我卸载了 JDK 1.7,瞧! my build worked.我的构建成功了。 (I also needed to fix an issue with package.json but I think that was a separate issue) (我还需要解决 package.json 的问题,但我认为这是一个单独的问题)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM