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.
+3


source to share


3 answers


For osx and the new Android Studio (2.3.3 at the moment), sdk is now in platforms ~ / Library / Android / and tools are in tools ~ / Library / Android / platform, so add them to our path instead of using brew.



0


source


Try to run sdkmanager "platforms;android-26"

. This is because the base tools are not installed to be recognized as a valid SDK directory.



+5


source


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

      

-1


source







All Articles