PhoneGap的 - 建筑PhoneGap的Andr​​oid应用程序提供了在Linux编译出错 [英] PhoneGap - Building phonegap android app gives compile error on Linux

查看:170
本文介绍了PhoneGap的 - 建筑PhoneGap的Andr​​oid应用程序提供了在Linux编译出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误,同时建立在我的Linux(Ubuntu的12.04)机PhoneGap的Andr​​oid应用程序。 我已经安装了nodejs,设置JAVA_HOME,ANT_HOME,ANDROID_HOME VAR和$ JAVA_HOME / bin中,$ ANT_HOME / bin中,$ ANDROID_HOME /工具,$ ANDROID_HOME /平台工具的路径。当我运行命令的PhoneGap本地构建Android ,我收到以下错误:

I am getting error while building phonegap android app on my linux (ubuntu 12.04) machine. I have installed nodejs, set JAVA_HOME, ANT_HOME, ANDROID_HOME vars and $JAVA_HOME/bin, $ANT_HOME/bin, $ANDROID_HOME/tools, $ANDROID_HOME/platform-tools to the path. when I am running command phonegap local build android, I am getting following error:

ME@My-PC:/dos/PhoneGap/HelloWorld$ phonegap local run android 
[phonegap] compiling Android...
    [error] An error occurred while building the android project. 
module.js:340
    throw err;
          ^
Error: Cannot find module 'shelljs'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/dos/PhoneGap/HelloWorld/platforms/android/cordova/lib/build.js:22:15)
    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 Module.require (module.js:364:17)

感谢您帮助

推荐答案

您必须

$cordova platform remove android

$cordova platform add android

因为目录中缺少

because there is directory is missing in

平台/安卓/科尔多瓦/ node_modules / shelljs

platforms/android/cordova/node_modules/shelljs

也可以创建其他应用程序,并复制丢失的文件,并在你的应用程序添加

or you can create another app and copy the missing file and add it in your app

近日的解决方案

在终端到您的应用程序 那么

in terminal go to your app then

cd platforms/android/cordova
sudo npm install shelljs

它的正常工作与我

it's working fine with me

这篇关于PhoneGap的 - 建筑PhoneGap的Andr​​oid应用程序提供了在Linux编译出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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