android - 为什么我的phonegap build android 命令不起作用?

标签 android cordova command

我是phonegap 3和android开发的新手。

我尝试了命令“phonegap build android”并得到:

[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
   [error] An error occured during creation of android sub-project.
fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'C:\Users\Michael\.cordova\lib\android\
cordova\3.1.0\VERSION'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.readFileSync (fs.js:284:15)
    at Object.exports.createProject (C:\Users\Michael\.cordova\lib\android\cordo
va\3.1.0\bin\lib\create.js:116:22)
    at Object.<anonymous> (C:\Users\Michael\.cordova\lib\android\cordova\3.1.0\b
in\create:34:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

最佳答案

我只是添加一个名为 VERSION 的空文件:

C:\Users\myuser\.cordova\lib\android\cordova\3.1.0\VERSION

之后,我在里面写了这样的文字:

3.1.0 

之后,再次运行phonegap:

[phonegap] adding the Android platform...
[phonegap] compiling Android...
[phonegap] successfully compiled Android app

祝你好运!

关于android - 为什么我的phonegap build android 命令不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19522772/

相关文章:

android - Admob背景颜色

android - 由于设备方向更改,在调整 webView 大小时更改应用程序可见的背景颜色

android - 如何处理 Android 中的重复字符串以减少内存使用?

android - 在 Fragment View 中获取组件的宽度和高度

javascript - 如何在 Cordova 中几秒钟后执行 JS 代码?

vim - 我想打开 vim 并查看上一个 session 中的 ":"命令。那可能吗?

wpf - 命令绑定(bind)到 ContextMenu(在 ListBox 中的 ListBoxItem 上)不起作用

mvvm - 将 MvxCommand 与 CommandParameter 绑定(bind)一起使用

android - android 的窗口 azure 移动服务根据不同的值获取多条记录

cordova - 添加cordova平台ios时出错