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

Laptopがおニューになったので、mixiさんのAndroidTrainingを再度取り込んだら以下のように怒られた。

SDK location not found

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

AndroidStudioに表示されたエラーは以下。

https://gist.github.com/daipresents/cf1d92b6bd92fd1d7d4eee1022468f03.js?file=gistfile1.txt

どうもSDKの場所が設定されていないらしい。だから、ログにもあるように

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

local.propertiesANDROID_HOMEの設定が必要。

local.propertiesは新しいプロジェクトを作れば自動作成されるので、新しくプロジェクトを作ってそれを流用。build.gradleと同じ場所においてあげる。Windows10だと

sdk.dir=C\:\\Users\\${username}\\AppData\\Local\\Android\\Sdk

になるらしい。

https://gist.github.com/daipresents/cf1d92b6bd92fd1d7d4eee1022468f03.js?file=gistfile2.txt

参考:

広告