RN遇到 SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable解决方法

RN在macOS下遇到下面错误:

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

解决方法:
在/android目录下添加local.properties文件,并且在里面配置环境变量:

sdk.dir=/Users/$USERNAME/Library/Android/sdk

$USERNAME指的是当前用户的用户名。

你可能感兴趣的:(RN遇到 SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable解决方法)