mac搭建android环境sdk路径问题

安装AndroidStudio后,执行react-native run-android报如下:

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

是因为ANDROID_HOME没有配置。

Mac下默认安装AndroidStudio后,sdk路径为cd ~/Library/Android/sdk/,需添加以下配置到 ~/.bash_profile:

export ANDROID_HOME=/Users/apple/Library/Android/sdk

export PATH=${PATH}:${ANDROID_HOME}/tools

export PATH=${PATH}:${ANDROID_HOME}/platform-tools

你可能感兴趣的:(mac搭建android环境sdk路径问题)