Setup Android Studio on Mac OSX

Posted May 20, 2015
Tagged

In this NEWB guide we walk you through getting ready for Android development on your Mac, you dirty yuppie hipster! Getting ready for Android development on your mac is pretty straightforward. Just download a bunch of shit and boom, you're on your way to making the next Tinder.

Download Android Studio and Java Virtual Machine(JVM) for Mac

The first thing you need to download is Android Studio and install it like any other Mac app. After you've got Android Studio downloaded just run the installer and drag Android Studio to your Applications folder.

Android Studio Android Studio

Android Studio will prompt you to download Java for OSX if you don't have it. After you install the JVM Android Studio will open up into a setup wizard.

Java JVMJava JVM

Open Android Studio and Begin Your Journey to Greatness

After installing Java, Android Studio opens up and you're prompted to step through a few wizards.  

Android Studio Wizard Android Studio Wizard

If you're just starting Android development your best bet is to leave all the settings as the defaults. So just follow the mother fucking wizard! Android Studio needs to download a bunch of stuff for you, like SDKs, device images, APIs and more.

Android Studio Downloads Shit Android Studio Downloads a BUTTLOAD of Stuff

We recommend sticking with the Standard setup if you're just starting out

Android Studio Standard InstallKeep it standard until you get de-virginized

Welcome to Android Studio!

And FINALLY, we're ready to actually make something happen! To get going, just click on "Start a new Android Studio Project" and you'll be taken through a few screens to start a new project. We cover this in the CodeBabes Android Course Intro.

Start a new Android projectStart a new Android project

Typical Android Studio Problems

Now after you get Android Studio open there are a few errors that people typically encounter. One that will be immediately obvious is if the virtual phone doesn't render correctly in the Design view. This is demoralizing, a kick in the straight in the balls. You just spent at least 30 minutes getting all this stuff set up, probably did about 50 google searches trying to find shit and here is one more problem just to test your resolve. To be an Android developer you have to WANT IT!

Rendering Problems, or Phone is missing

If there's a rendering issue, or the phone isn't loading you should change the AppTheme in the design view. Newer versions of Android Studio also resolve this bug.

 Typical Android Studio Issues Typical Android Studio problems

Android Studio is looking for the wrong SDK, or the SDK is not installed

The second issues is the Java JDK on your computer is not compatible with the Android SDK version you're using, or the JDK doesn't even exist. Usually OSX comes with JDK 6 though. However, if you're targeting a recent release of Android you'll need to compile with JDK 7, so go download it here!

Get Java JDK 7Get Java JDK 7

Changing the Java Development Kit (JDK) Version

To change the JDK version your Android Studio project is referencing, go to File > Project Structure and you'll see the following screen where we need to update the JDK from 6 to 7.

Update JDK to 7Update JDK to 7

Find the new JDK

To find JDK 7 click the little box to the right of the JDK location field. The JDK installer sticks the JDK 7 in /System/Library/JavaVirtualMachines. All you need to do is open the JDK 7 directory, select 'home', then press OK and you're ready for some hot compiling action!!

Finding JDK 7Finding JDK 7 in OSX

Select the 'Home' directory

Select the correct Java JDKSelect the correct Java JDK for the API you're running

Once you're done with that you should be ready to actually start building some apps. May the force be with you, seriously, don't give up. Android development is HARD, but the it'll be worth it, we promise!