Installing Android Studio and the SDK
Android Studio is one download, but what it installs is a dozen separate things, and most "it won't build" problems in your first month come from one of them being missing or the wrong version. This lesson installs everything, then opens the box and names each piece, so that when an error mentions a "platform" or "build-tools" you know exactly what it is talking about.
Before you download: be honest about your machine
Android Studio is heavy. Google's own published requirements, for Windows, Mac and Linux alike:
| Minimum | Recommended | |
|---|---|---|
| RAM | 8 GB for Studio alone, 16 GB for Studio and the emulator | 32 GB |
| Free disk | 8 GB for Studio alone, 16 GB with the emulator | SSD with 32 GB or more |
| CPU | Virtualisation support enabled (Intel VT-x or AMD-V); on a Mac, Apple M1 or newer, or a 6th-generation Intel Core | A recent i5/i7/Ryzen 5+ or Apple silicon |
| OS | 64-bit Windows 10, macOS 12, or a 64-bit Linux | The latest version |
Two lines in the small print matter: Windows and Linux machines with ARM processors are not supported, and Google says it is phasing out Intel Macs.
Here is what those numbers mean in practice.
8 GB of RAM is the realistic floor, not a comfortable minimum. With 8 GB you can run Android Studio and a browser. Add the emulator, which is a whole second operating system, and the machine starts swapping to disk and everything slows to a crawl. If you have 8 GB, plan to run the course's app on your own phone over USB (lesson 4) and keep the emulator closed. That is a perfectly good way to learn.
The disk requirement grows. The "8 GB free" is for day one. Here is a real development machine after several Android projects:
4.9G ndk native C/C++ toolchain (you do not need it)
12G system-images four emulator images, 2.2 to 4.2 GB each
1.1G build-tools seven versions
967M emulator
957M platforms seven Android versions
21G total Android SDK
8.6G ~/.gradle/caches downloaded libraries and build outputs
Each emulator you create also keeps its own disk image, between 3 and 9 GB here. Thirty to forty gigabytes on a working machine is normal. Budget for it, and uninstall what you are not using (the practice section shows how).
Installing it
Download Android Studio from developer.android.com/studio. It is large, so use a good connection; the first-run setup then downloads a few more gigabytes of SDK components on top. On patchy mobile data, do this at a time when you can leave it running.
- Windows: run the
.exeinstaller and accept the defaults. - Mac: open the
.dmg, drag Android Studio into Applications, then launch it from there. - Linux: unpack the
.tar.gzsomewhere like/opt/, then runstudiofrom theandroid-studio/bin/directory.
On first launch Android Studio runs its Setup Wizard. Take the recommended options, accept the licences, and let it download the SDK components it recommends. When it finishes you land on the Welcome screen, with New Project at the top.
You do not need to install Java separately. Android Studio ships with its own JDK and uses it for builds by default.
What you installed: the SDK
Android Studio is the editor. The Android SDK (software development kit) is the set of tools and
files that actually build and run Android apps, and it lives in its own folder, separate from Android
Studio. On a Mac it is ~/Library/Android/sdk; on any machine, the SDK Manager shows the path at
the top as Android SDK Location.
Inside that folder, each directory is a separately versioned package:
| Folder | What it is | Size here | Do you need it? |
|---|---|---|---|
platforms/android-37.2 |
An SDK platform: the Android API your code compiles against. Its android.jar (44 MB) holds the signatures of every class Android offers, such as Bundle and Activity. |
155 MB | Yes, exactly the version your project names |
build-tools/37.0.0 |
Build tools: aapt2 (compiles resources), d8 (turns compiled code into Android's DEX format), zipalign and apksigner (package and sign the APK) |
192 MB | Yes; Gradle picks the version |
platform-tools |
adb, the bridge between your computer and a phone or emulator |
32 MB | Yes |
emulator |
The program that runs a virtual Android device | 967 MB | Only if you use the emulator |
system-images/... |
A system image: a complete Android operating system for the emulator to boot, one per Android version and processor type | 2 to 4 GB each | One, for lesson 4 |
cmdline-tools |
sdkmanager and friends, for managing all this from a terminal |
158 MB | Useful |
ndk |
Native Development Kit, for C and C++ code | 5 GB | No. Do not tick it |
The distinction that confuses everyone at first: an SDK platform is what you compile against; a system image is what you run on. They are separate downloads. You can compile against Android 37 and run on an emulator with Android 16, and you will, because your users are on older versions.
The SDK Manager
Open it from Tools → SDK Manager, or with the SDK Manager button in the toolbar. (If no project is open yet, the Welcome screen has it under its extra actions.) It has two tabs that matter:
- SDK Platforms: one row per Android version. Ticking a row installs that platform.
- SDK Tools: build tools, platform tools, the emulator, command-line tools, the NDK.
Tick what you want, untick what you want removed, then Apply. A dash in a checkbox means an update is available.
Install platform 37.2 for this course
Android now ships minor API releases between the yearly major ones, so a platform can be numbered 37.2 rather than plain 37: API level 37, second minor release. The libraries Mandi Bhav uses require compiling against API 37 or later, and the course project is set to 37.2.
In the SDK Platforms tab, turn on the option to show package details (each Android version then expands into its individual packages), find Android SDK Platform 37.2, tick it and apply. If the wording in your version of Android Studio differs, look for the package whose name ends in 37.2.
If you prefer a terminal, the command-line tool does the same thing. From the SDK folder (on Windows
the tool is sdkmanager.bat):
cmdline-tools/latest/bin/sdkmanager "platforms;android-37.2"
To check what is installed:
cmdline-tools/latest/bin/sdkmanager --list_installed
Trimmed to the lines that matter, a machine ready for this course shows:
build-tools;37.0.0 | 37.0.0 | Android SDK Build-Tools 37
platform-tools | 36.0.0 | Android SDK Platform-Tools
platforms;android-36 | 2 | Android SDK Platform 36
platforms;android-37.2 | 2 | Android SDK Platform 37.2
emulator | 35.6.11 | Android Emulator
system-images;android-36;google_apis_playstore;arm64-v8a | 6 | Google Play ARM 64 v8a System Image
Your version numbers will be newer than these over time. The platforms;android-37.2 line is the
one that must be there.
The trap: an SDK missing a platform
Every Android project names the platform it compiles against. If that platform is not in your SDK, two different things can happen, and which one you get depends on your connection.
If you are online and have accepted the SDK licences, the build quietly fetches it for you. A real build against an SDK without 37.2 printed this before carrying on:
Checking the license for package Android SDK Platform 37.2 in .../sdk/licenses
License for package Android SDK Platform 37.2 accepted.
Preparing "Install Android SDK Platform 37.2 (revision 2)".
Installing Android SDK Platform 37.2 in .../sdk/platforms/android-37.2
"Install Android SDK Platform 37.2 (revision 2)" finished.
Convenient, and a trap in itself: your first build stalls on a download you did not know about, which on mobile data in a weak spot can take a very long time or fail half-way.
Offline, the same build fails immediately:
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to find target with hash string 'android-37.2' in: .../sdk
"Target with hash string android-37.2" is Gradle's way of saying platform 37.2 is not installed.
The fix is the SDK Manager step above. Install the platform deliberately, on a good connection,
before you need it.
There is a second, related failure where the platform is installed but your project asks for one that is too old for its libraries. That one fails with a long list of "requires ... version 37 or later" messages, and the Gradle lesson in module 2 walks through it line by line.
One virtual device, so the next lesson can run
The next lesson ends by running Mandi Bhav, so create one virtual phone now and accept the defaults. Open the Device Manager (View → Tool Windows → Device Manager), click +, choose to create a virtual device, pick a recent Pixel, take the Recommended system image (download it if it shows a download icon, 2 to 4 GB) and finish the wizard. Do not tune anything yet. Lesson 4 explains every choice in that wizard, adds your real phone, and then deliberately makes the emulator slower so it behaves more like your users' phones.
Keeping it up to date
Android Studio tells you when an update is available. To check by hand, use Help → Check for Update on Windows and Linux, or Android Studio → Check for Updates on a Mac. SDK packages are updated from the SDK Manager. Update when you start a project rather than in the middle of one; a new version of a build tool the night before a deadline is a risk you do not need.
Check your work
Is 8 GB of RAM enough? Enough for Android Studio, not comfortable with the emulator too. With 8 GB, test on a real phone.
What is the difference between an SDK platform and a system image? The platform is what you
compile against (android.jar); the system image is a whole Android OS the emulator boots. Separate
downloads.
Which SDK folder holds adb? platform-tools.
What does d8 do? Converts compiled code into DEX, the format Android runs.
What does 37.2 mean? API level 37, minor release 2.
You see "Failed to find target with hash string 'android-37.2'". What is wrong and how do you fix it? Platform 37.2 is not installed and the build could not fetch it. Install Android SDK Platform 37.2 from the SDK Manager.
Do you need the NDK for this course? No.
Practice
- Install Android Studio and finish the Setup Wizard.
- Open the SDK Manager and write down your Android SDK Location. Open that folder in Finder, Explorer or a terminal and match each directory against the table above.
- Install Android SDK Platform 37.2 and confirm it appears as
platforms/android-37.2. - Run
sdkmanager --list_installedand compare your output with the trimmed one above. - Find out how big your SDK folder is right now (Get Info on a Mac, Properties on Windows,
du -shon Linux). Write the number down and check it again after lesson 4, once you have an emulator. - Harder: on your machine, work out a disk budget for this course: SDK, one system image, one emulator's data and the Gradle cache. If it does not fit, decide now what to remove, using the SDK Manager rather than deleting folders by hand (a hand-deleted package confuses the SDK Manager, which still thinks it is installed).
Official documentation
- Install Android Studio — The current system requirements for each operating system and the install steps, which change between releases.
- Update the IDE and SDK tools — The SDK Manager in detail, including what each required package is for.
- sdkmanager — Every command-line option, for installing and updating packages without opening Android Studio.
Next: creating Mandi Bhav and running it for the first time.
Stuck on this lesson?
Being stuck is part of it — but being stuck alone for three days is not. Selected students who finish a course can join our internship, with real-world projects and code review from a working engineer.
About the internship