ANDROID_HOME未设置和"机器人"命令不在PATH的PhoneGap [英] ANDROID_HOME is not set and "android" command not in your PATH Phonegap

查看:139
本文介绍了ANDROID_HOME未设置和"机器人"命令不在PATH的PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Android的包,我已经在.bashrc文件中配置好了一切,甚至当我说Android在命令行..我得到的Andr​​oid经理..但是当我说的离子平台添加android的我总是得到错误的错误:ANDROID_HOME未设置和Android的命令,不是在你的路径,必须满足这些条件中的至少一个。 。我想不是固定不变的许多方式,但问题。

i have installed android bundle and i have configured everything in .bashrc file and even when i say android in command line .. i am getting android manager .. but when i say ionic platform add android i am always getting error as "Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions." . i tried many way but issue not fixed .

我的平台:

Ubuntu的14.04的64位

Ubuntu 14.04 64 bit

.bashrc文件:

.bashrc file :

    export HOME="/home/system"
    export ANDROID_HOME="$HOME/adt-bundle-linux-x86_64-20140702/sdk/tools"
    export ANDROID_PLATFORM_TOOLS="$HOME/adt-bundle-linux-x86_64-20140702/sdk/platform-tools"
    export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
    export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
    export ANT_HOME="/usr/share/ant"
    export PATH="$ANT_HOME/bin:$PATH"
    export ANDROID_HOME="/home/system/adt-bundle-linux-x86_64-20140702/sdk/tools"

错误而执行

    system@system-H81M-S1:/usr/share/nginx/www/myApp# ionic platform add android
    npm http GET https://registry.npmjs.org/cordova-android/3.6.3
    npm http 200 https://registry.npmjs.org/cordova-android/3.6.3
    npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-3.6.3.tgz
    npm http 200 https://registry.npmjs.org/cordova-android/-/cordova-android-3.6.3.tgz
    Creating android project...

    /system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:126
    throw e;
    ^
    Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
    at /system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/lib/check_reqs.js:158:19
    at _fulfilled (/system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:760:13)
    at /system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:821:14
    at flush (/system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3

    Error: /system/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/
    create: Command failed with exit code 8 at ChildProcess.whenDone  (/usr/lib/node_modules/cordova/node_modules/
    cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

可我知道我可以解决这个错误

may i know how i can fix this error

推荐答案

我面临同样的问题,它的解决。

I faced the same problem, and it's solved.

我认为这是问题的最新科尔多瓦与最新的Andr​​oid的兼容性。 除了你的Andr​​oid主路径已经问题。

I think it's issue with the compatibility of the latest cordova with latest android. As well as you've issue with the android home path.

在.bashrc文件

export HOME="/home/indranil"
export ANDROID_HOME="$HOME/software/adt-bundle-linux-x86_64-20140702/sdk"
export PATH="$HOME/software/adt-bundle-linux-x86_64-20140702/sdk/tools:$ANDROID_HOME/platform_tools:$PATH"

尝试,如果你使用的是旧版本,下载最新的Andr​​oid SDK。 而从Android经理下载Android 4.4.2(API 19)。

Try to download the latest android SDK if you're using older version. And download Android 4.4.2(API 19) from your android manager.

您可以使用最新的科尔多瓦(4.0.0),但如果问题仍然存在,然后用科尔多瓦(3.5.0-0.2.7),但如果你想升级或降级的科尔多瓦,使用删除现有: -

You can use the latest cordova (4.0.0) but if the issue is still there then use cordova (3.5.0-0.2.7), but if you want to upgrade or downgrade the cordova, remove the existing one using:-

npm uninstall -g cordova  (If linux use sudo npm uninstall -g cordova)

如果您使用的是Linux不使用     须藤

If you are using linux don't use sudo

commad在安装cordoava的时候,如果你收到任何错误,运行以下命令

commad at the time of installing cordoava, if you get any error, run the following commands

sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
sudo chown -R `whoami` /usr/local

然后安装科尔多瓦没有sudo

Then install cordova without sudo

npm install -g cordova@3.5.0-0.2.7

在创建离子应用程序,并加入Android作为平台,不使用sudo命令的时间。 科尔多瓦在加入平台的时候会在家里文件夹.cordova目录。创建新的离子应用程序之前删除该目录。

At the time of creating ionic app and adding android as platform don't use sudo command. Cordova creates a .cordova directory in the home folder at the time of adding platform. Remove that directory before creating the new ionic application.

和下载的Andr​​oid(4.4.2)后,使用命令创建一个Android虚拟设备:

And after downloading the android(4.4.2), create an android virtual device using the command:

android avd

这篇关于ANDROID_HOME未设置和"机器人"命令不在PATH的PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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