我为Apache Cordova完成了VS 2015 Enterprise + Tools的完整安装.当我打开或创建任何项目时,它不会构建甚至在"运行"按钮上显示"波纹仿真器"或"设备"信息.
我已经完全重新安装并仍然相同.
当我在配置窗口单击依赖关系检查按钮时,一切正常.
当我尝试构建时:
错误的ERR!Windows_NT 6.3.9600 1> npm ERR!argv"node""C:\ Users \%UserProfile%\ AppData\Roaming \npm \node_modules \npm\bin \npm-cli.js"" - g""install""C:\ Program Files(x86)\ Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac"" - "lllvelvel""warn"1> npm ERR!node v0.12.2 1> npm ERR!npm v2.12.0 1> npm ERR!undefined不是函数1> npm ERR!1> RUNMDAINSTALL:npm ERR!如果您需要帮助,可以在以下位置报告此错误:1> npm ERR! https://github.com/npm/npm/issues1> npm ERR!请在任何支持请求中包含以下文件:1> npm ERR!C:\ Users \%UserProfile%\ Documents\Visual Studio 2015\Projects\BlankCordovaApp10\BlankCordovaApp10 \npm-debug.log 1> ------ npm install failed.退出代码:1 1> ------包安装失败.重试... 1> npm WARN卸载未安装在C:\ Program Files(x86)\nodejs \node_modules:"vs-tac"1> npm ERR!Windows_NT 6.3.9600 1> npm ERR!argv"node""C:\ Users \%UserProfile%\ …
visual-studio-cordova visual-studio-2015 taco tools-for-apache-cordova
我正在尝试按照拍照并获取 Cordova Camera Plugin 的FileEntry对象示例.我在Visual Studio 2017中使用Cordova Simulate通过选择"在浏览器中模拟"来测试该示例
拍摄照片并在模拟器中显示图像,使用与imageUrl此代码段中传递给Cordova Files插件相同的图像:
function cameraSuccess(imageUri) {
window.resolveLocalFileSystemURL(imageUri, function () {
console.log('success')
}, function (error) {
console.log(error.message);
});
return imageUri;
}
Run Code Online (Sandbox Code Playgroud)
但是,对resolveLocalFileSystemURL的调用失败,并显示以下错误:
提供给API的URI格式不正确,或者生成的数据URL超出了数据URL的URL长度限制.
为了让这个工作,我需要做什么?
编辑 我在插件文档的Chrome Quirks部分找到了此说明
resolveLocalFileSystemURL方法要求入站URL具有文件系统前缀.例如,resolveLocalFileSystemURL的url参数应该是文件filesystem:file:///persistent/somefile.txt,而不是Android中的表单file:///persistent/somefile.txt.
所以我将代码更改为:
if (device.isVirtual) {
if (!window.isFilePluginReadyRaised) {
//added to check another potential Chrome quirk
//the alert wasn't never shown so I don't think it's an issue
alert('!window.isFilePluginReadyRaised');
}
imageUri= 'filesystem:' + imageUri;
}
window.resolveLocalFileSystemURL(imageUri, function () {
console.log('success');
}, function …Run Code Online (Sandbox Code Playgroud) cordova cordova-plugins visual-studio-2017 tools-for-apache-cordova