Android Studio will not use Brew Cask Android-SDK Directory
We try to maintain scripts to quickly deploy new developers and maintain consistency between teams / contributors. We used the Android SDK and NDK tools to install via the command line as part of our scripts, downloaded all the platforms and tools we needed, and then set up android studio to use them. Since the release of Android 26, this has not been possible, and Android wants it all done through Studio. Is there any reason why the script below doesn't work?
Mac OSX Android Studio: 2.3.3 - Installed via brew cask install android-studio
(Homebrew)
Android SDK 26: Installed via brew cask install android-sdk
Android rc file (obtained in bash_profile)
export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
export ANDROID_HOME=/usr/local/share/android-sdk/
export ANDROID_NDK_HOME=/usr/local/share/android-ndk
Steps to reproduce:
- Install above dependencies using your homebrew container.
- Update environment variables (export them to bash profile or the like).
- Open Android Studio - it should ask to install the SDK.
- Try using
share
sdk (android sdk root path). - Android Studio says sdks is invalid and not empty.
source to share
To make Android Studio happy with brew, I had to "brew":
brew cask install android-sdk
brew cask install android-platform-tools
sdkmanager "platforms;android-27"
sdkmanager "build-tools;27.0.3"
sdkmanager "extras;android;m2repository"
sdkmanager "extras;google;m2repository"
sdkmanager "sources;android-27"
and my ANDROID_HOME:
/usr/local/share/android-sdk
source to share