我试图安装PhoneGap,我得到以下错误:
错误:ANDROID_HOME没有设置,“android”命令不在你的路径中。你必须至少满足其中一个条件。
错误(截图)
我怎么做才能确保Android正确设置为使用Cordova?
我试图安装PhoneGap,我得到以下错误:
错误:ANDROID_HOME没有设置,“android”命令不在你的路径中。你必须至少满足其中一个条件。
错误(截图)
我怎么做才能确保Android正确设置为使用Cordova?
当前回答
在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
其他回答
主要原因是appium中没有设置路径(ANDROID_HOME)。您可以先检查最后一步来确认这一点
步骤1:-签出android sdk所在的路径
它可能在c驱动器/程序文件或下面的位置 当地C:\Users\ yourUserName \ AppData \ \ Android \ Sdk
步骤2:-设置系统变量。在窗口搜索栏中输入(可打开此窗口设置系统变量)
最后一步:-确认问题不会重复验证这一点,打开appium点击编辑配置,并确认是否可以看到路径设置
对于Windows,我只需要添加一个指向SDK文件夹的env变量。完成了! (公认的答案对我不起作用)
对于那些在windows上使用Ionic Framework并且在他们的pc上没有安装Android studio的人,你必须下载Android studio或在列表中下载SDK管理器。
如果你选择SDK管理器选项,你必须设置环境变量的路径:
Variable name: ANDROID_HOME, Variable value: the path where you installed the android SDK, in my case is, C:\Android\android-sdk. You have to add the variable to the Path variable system by adding this: ;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;. Then if you got the "JDK error" just download it from the Oracle website and create a system variable like the Android SDK: Variable name: JAVA_HOME, Variable value: the path where you installed the JDK, in my case is, C:\Program Files\Java\jdk1.8.0_144. Then add it to the Path variable system by adding ;%JAVA_HOME%\bin. Then if you got the "Gradle error" just fallow the installations steps on the official website of gradle. Finally you can continue to creating your ionic app's apk.
注意:你必须重新打开cmd窗口几次或重新启动你的电脑后做出这些改变。希望这对你有用。
在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。
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.
这就是你所需要做的。