React Native Android构建失败.找不到SDK位置
问题描述:
当我开始运行android时出现错误
I have error when i start running android
What went wrong:
A problem occurred evaluating project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
答
- 转到您的本机项目的
android/
目录 - 使用以下行创建一个名为
local.properties
的文件: - Go to the
android/
directory of your react-native project - Create a file called
local.properties
with this line:
sdk.dir = /Users/USERNAME/Library/Android/sdk
USERNAME
是您的macOS用户名
Where USERNAME
is your macOS username