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

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

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.

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *