未找到 SDK 位置 - Android Studio

SDK Location not found- Android Studio

我在编译项目时遇到这个错误: 错误:找不到 SDK 位置。使用 local.properties 文件中的 sdk.dir 或 ANDROID_HOME 环境变量定义位置。 This is a screenshoot of the error

我该如何解决? SDK位置很好。问题是我不知道 ANDROID_HOME 环境变量是什么。

如果您使用的是Windows:

Go to My Computer -> System Properties -> Advanced System Settings -> Environment Variables

添加一个变量 ANDROID_HOME 作为变量名,并添加你的 sdk 路径作为它的值。

希望对您有所帮助。