我试图安装PhoneGap,我得到以下错误:
错误:ANDROID_HOME没有设置,“android”命令不在你的路径中。你必须至少满足其中一个条件。
错误(截图)
我怎么做才能确保Android正确设置为使用Cordova?
我试图安装PhoneGap,我得到以下错误:
错误:ANDROID_HOME没有设置,“android”命令不在你的路径中。你必须至少满足其中一个条件。
错误(截图)
我怎么做才能确保Android正确设置为使用Cordova?
当前回答
你只需要在flutter_console.bat中输入一个命令,输入flutter config——android-sdk <path-to-your-android-sdk-path>
其他回答
在Mac上使用Android Studio,在你的终端上运行这个:
export ANDROID_HOME=/Applications/Android\ Studio.app/sdk/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools
然后,当你打字的时候
android
在您的终端上,它将运行一些内容
如果其他方法都不起作用,请确保在构建过程中设置了正确的权限和所有权。快速解决方法可以是:
sudo chown -R <you>:<your_group> *
sudo chmod -R 755 *
顺便说一下,另一种可能是你有一个太旧版本的cordova android平台。
错误:Android SDK未找到。确保已安装。如果它不在默认位置,则设置ANDROID_HOME环境变量。
然后:
cordova platform update android --save
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.
这就是你所需要做的。
这就是我想要的。我在:
os x Yosemite版本10.10.2 Cordova 4.2.0版 Android studio 1.0.1 Java SE开发工具包7
设置路径:
# on ~/.zshrc file (open a text editor)
export ANDROID_HOME="/Users/<user>/Library/Android/sdk/"
export ANDROID_TOOLS="/Users/<user>/Library/Android/sdk/tools"
export ANDROID_PLATFORM_TOOLS="/Users/<user>/Library/Android/sdk/platform-tools"
PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS
打开终端
从android SDK管理器安装“android-19”
$ android
# pick "SDK Platform Android 4.4.2, API 19"
然后进入一个基于cordova的项目目录
$ ionic platform add android