原因はlocal.propertiesがプロジェクトルートに無いこと。 local.propertiesを作り、中身を以下のようにすればよい。
## This file is automatically generated by Android Studio. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! # # This file must *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. # # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. #Wed Jan 07 15:34:05 JST 2015 sdk.dir=/Users/username/android-sdk-macosx
sdk.dirの指定に~/や$HOME/は使えなかった。なぜだ。。
参考: