$ANDROID_HOME is not defined.

在执行gradlew命令时,出现$ANDROID_HOME is not defined错误,以下步骤经测试已解决问题。
1.在命令行中输入如下命令:

open  ~/.bash_profile 

2.在.bash_profile文件中首行加入如下代码:

export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH

3.保存更改结果

source ~/.bash_profile

4.测试

echo $ANDROID_HOME

你可能感兴趣的:(android,mac)