我试图安装PhoneGap,我得到以下错误:

错误:ANDROID_HOME没有设置,“android”命令不在你的路径中。你必须至少满足其中一个条件。

错误(截图)

我怎么做才能确保Android正确设置为使用Cordova?


当前回答

windows:

右键单击“我的电脑”->属性->高级系统设置->环境变量 将系统变量的路径编辑为;\yourSdkHome\tools;\yourSdkHome\platform-tools。

然后关闭cmd提示符并重新打开。

其他回答

Go to system properties. Click change setting. Click advance tab. Click Environment Variables button. In system variables area click new button. Set ANDROID_HOME in the Variable name field. Set C:\Program Files (x86)\Android\android-sdk in the Variable value field. Click ok button. Double click Path variable in the list. Click new button. Past C:\Program Files (x86)\Android\android-sdk\platform-tools in the filed. Click new button again. Past C:\Program Files (x86)\Android\android-sdk\tools in the field. Press enter 3 times.

这就是你所需要做的。

你只需要在flutter_console.bat中输入一个命令,输入flutter config——android-sdk <path-to-your-android-sdk-path>

只需要一个改变就可以解决这个问题:

执行“开始->控制面板->系统->高级(tab) ->环境变量->系统变量”

设置ANDROID_HOME为C:\Program Files (x86)\Android\ android-sdk

在Windows上使用Android Studio,系统变量设置发生了一些变化。

你仍然需要添加一个系统变量ANDROID_HOME,但是指向包含android SDK的目录,通常安装在C:\Users\YOUR_USERNAME\AppData\Local\ android \android-studio\ SDK。

您还需要向Path系统变量添加以下内容:

% ANDROID_HOME % \平台工具;% ANDROID_HOME % \工具;

摘自:https://github.com/simnova/webdevdocs/wiki/Installing-PhoneGap-and-Android-Studio-on-Windows

SDK路径也在C:\Users\USER\AppData\Local\Android\sdk

在Linux上,将此添加到你的.bashrc, .profile或适当的shell文件的末尾:

export ANDROID_HOME=/home/youruser/whatever/adt-bundle-linux-x86_64-20140702/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools

请注意,这些环境变量将用于新创建的shell,而不是已经打开的shell。