1. 程式人生 > >[Android] SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment

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

從網路上下載了一個範例,開啟時會顯示這個錯誤:

I recently tried to import sample Android games I downloaded from Google’s developer website. After importing them into Android Studio, I’m getting the following error:

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

environment variable.

解法:

The project might be missing a settings.gradle file. Make sure that file exists from the project you are importing. If not add the settings.gradle file with the following :

include ':app'

Save the file and put it at the top level folder in your project.