简体   繁体   English

在VMware上使用Visual Studio 2015 Cordova调试Android应用,并发现debug.keystore错误

[英]debug Android app using Visual Studio 2015 Cordova on a VMware and have debug.keystore not found error

The build is OK until it's asking for a debug key. 在请求调试密钥之前,构建是确定的。 Here is part of the output log: 这是输出日志的一部分:

[apkbuilder] Creating MainActivity-debug-unaligned.apk and signing it with a debug key...
1>MDAVSCLI : [apkbuilder] keytool error : java.io.FileNotFoundException: \\vmware-host\Shared Folders\.android\debug.keystore (The system cannot find the path specified)
1>  [apkbuilder] Picked up _JAVA_OPTIONS: -Xmx512M
1>  Command finished with error code 1: C:\FirstApp\FirstApp\platforms\android\cordova\build.bat --debug
1>ERROR building one of the platforms : error : C:\FirstApp\FirstApp\platforms\android\cordova\build.bat: Command failed with exit code 1
1>  You may not have the required environment or OS to build this project
1>MDAVSCLI : error : C:\FirstApp\FirstApp\platforms\android\cordova\build.bat: Command failed with exit code 1
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

I'm running a Windows 8.1 on mac Yosemite using VMware. 我正在使用VMware在Mac Yosemite上运行Windows 8.1。 Seems like it's trying to look for the debug key in share folder and couldn't find it. 似乎它正在尝试在共享文件夹中查找调试密钥,但找不到它。 I'm clueless how I can fix this problem. 我不知道如何解决此问题。

I've checked the environment variables, ADT_HOME, ANT_HOME, GIT_HOME, JAVA_HOME and they all point to the correct locations. 我已经检查了环境变量ADT_HOME,ANT_HOME,GIT_HOME,JAVA_HOME,它们都指向正确的位置。

%JAVA_HOME%\\bin is also added to the system environment PATH. %JAVA_HOME%\\ bin也已添加到系统环境PATH。

I figured it out. 我想到了。 The problem is that I can't create folder under \\vmware-host\\Shared Folders. 问题是我无法在\\ vmware-host \\ Shared Folders下创建文件夹。 This also gave me hard time when running Android SDK Manager to fetch Android repository because the Manifest Cache directory points to \\vmware-host\\Shared Folders too. 这也使我很难运行Android SDK Manager来获取Android存储库,因为清单缓存目录也指向\\ vmware-host \\ Shared Folders。

The solution is to add a new environment variable. 解决方案是添加一个新的环境变量。 Variable name: ANDROID_SDK_HOME Variable value: C:\\Users>User Name< 变量名称:ANDROID_SDK_HOME变量值:C:\\ Users>用户名<

This is the post that helps a lot. 这是一个很有帮助的帖子。 Possible to change where Android Virtual Devices are saved? 可以更改Android虚拟设备的保存位置吗?

Don't forget to restart the computer after the change. 更改后,请不要忘记重新启动计算机。

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

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