Detecting the version Android SDK is a basic task for developers, testers and even advanced users working with customizing firmware or debugging applications. Without an accurate version number, it is impossible to guarantee tool compatibility, properly configure the build environment, or diagnose errors. For example, if you use Gradle with an outdated version of the SDK, the project may simply refuse to compile, producing mysterious errors about library incompatibility.
The problem is complicated by the fact that Android SDK consists of several components: itself SDK Tools, Platform Tools, Build Tools and packages for specific versions of Android (for example Android 14 (API 34)). Each of them is updated independently, and their versions may not be the same. In this article we will analyze all the current verification methods - from the graphical interface Android Studio to the command line, and also explain which numbers are important for your task.
1. Checking the SDK version through Android Studio
The most visual and intuitive method is to use the built-in tools Android Studio. This method is suitable for both beginners and experienced developers, since it does not require knowledge of commands or file paths. Here are the step-by-step guide:
Open Android Studio and go to the menu File โ Settings (to macOS: Android Studio โ Preferences). In the left side menu, select Appearance & Behavior โ System Settings โ Android SDK. Here you will see two key tabs:
- ๐ SDK Platforms โ a list of installed versions of Android (for example,
Android 13 (Tiramisu)with API 33). This displays the target platformsapplications for which you can build applications. - ๐ง SDK Tools โtoolkit components such as
Android SDK Build-Tools,Android EmulatororPlatform-Tools. This is where the versions are indicated tools, not platforms.
Open SDK settings|View the SDK Platforms tab|Check versions in SDK Tools|Check with project requirements-->
Pay attention to column Version โthe current numbers are indicated here. For example, for Android SDK Platform-Tools it could be 34.0.4 (at the time of writing). If you need a version of a specific platform (for example, for parameter compileSdkVersion v Gradle), look for it in the section SDK Platforms.
โ ๏ธ Attention: Versions of components in Android Studio may be automatically updated when you start the IDE. If you need a specific version for build reproducibility, disable auto-updates in settings or use SDK Manager from the command line.
2. Command line: adb and sdkmanager
For those who prefer a terminal or work on servers without a GUI, there are two main tools: adb (for devices) and sdkmanager (for local SDK). The first will help you find out the version Android SDKinstalled on the connected device, and the second - the version of the tools on your computer.
To check the version Platform-Tools (which includes adb), run in the terminal:
adb --version
The output will be similar to:
Android Debug Bridge version 1.0.41Version 34.0.4-10406667
Installed as /Users/username/Library/Android/sdk/platform-tools/adb
The key line here is Version 34.0.4-10406667. The first two digits (34.0.4) indicate the version Platform-Tools, and the rest is the internal build.
To check all installed SDKs, use:
sdkmanager --list
This command will display a complete list of components with versions, including Build-Tools, Emulator and platforms. For example:
Path | Version | Description | Location---- | ------- | ----------- | --------
build-tools;34.0.0 | 34.0.0 | Android SDK Build-Tools 34 | build-tools/34.0.0
platform-tools | 34.0.4 | Android SDK Platform-Tools | platform-tools
platforms;android-34 | 3 | Android SDK Platform 34 | platforms/android-34
If the command sdkmanager is not found, add the SDK path to the environment variable PATH. For example, for Linux/macOS it could be export PATH=$PATH:/Users/username/Library/Android/sdk/tools/bin.
3. SDK version on a physical device or emulator
Sometimes you need to find out the version Android SDKthat is used on the device itself (smartphone, tablet) or in the emulator. This is relevant for debugging when the application behaves differently on different versions of the API. The methods depend on the type of device:
- ๐ฑ Physical device: Go to
Settings โ About phone โ Software information. Look for the lineAndroid version(for example,14) andNumber assembly(for example,UP1A.231005.007). The first number is API Level (for Android 14 it is 34). - ๐ฅ๏ธ Android Studio Emulator: Launch the emulator, open
Settings โ About tabletand findAndroid version. Or use the commandadb shell getprop ro.build.version.sdkfor the exact API Level.
To programmatically determine the SDK version in the application code use:
int sdkVersion = android.os.Build.VERSION.SDK_INT;
// Will return an integer, for example 34 for Android 14
โ ๏ธ Attention: On some custom firmware (for example, LineageOS or Pixel Experience), the build number may not correspond to official Google versions. In this case, check the API Level compliance table at apilevels.com.
4. Checking the version through the file system
All components Android SDK are stored in a local folder on your computer. The path depends on the operating system:
| OS | Typical path to SDK | Example location platform-tools |
|---|---|---|
| Windows | %LOCALAPPDATA%\Android\Sdk |
C:\Users\Username\AppData\Local\Android\Sdk\platform-tools |
| macOS | ~/Library/Android/sdk |
/Users/Username/Library/Android/sdk/platform-tools |
| Linux | ~/Android/Sdk |
/home/username/Android/Sdk/platform-tools |
To find out the version Platform-Tools:
- Go to the folder
platform-toolsat the path indicated above. - Find the file
source.propertiesand open it with any text editor. - Look for the line
Pkg.Revision- its value (for example,34.0.4) is current version.
For Build-Tools a similar file is located in folders like build-tools/34.0.0/source.properties. This method is useful if sdkmanager is unavailable for some reason.
What to do if there is no SDK folder?
If the folder with the SDK is missing, it means it was not installed or the path has been changed. In this case:
1. Open Android Studio and wait for the SDK to finish downloading (if this is the first launch).
2. Check the path in the settings: File โ Project Structure โ SDK Location.
3. If the SDK is not installed, download it via SDK Manager in Android Studio.
5. SDK version in a Gradle project
For developers working with Android Gradle Plugin, the SDK version is often specified directly in the project files. This is critical to build reproducibility, especially in teams. Main parameters:
- ๐
compileSdkVersionโ Android version for which the application is compiled (for example,34for Android 14). - ๐ ๏ธ
buildToolsVersionโversion Build-Tools (for example,"34.0.0"). - ๐ฏ
minSdkVersionandtargetSdkVersionโminimal and target versions, respectively.
Example from file build.gradle (Module: app):
android {compileSdkVersion 34
buildToolsVersion "34.0.0"
defaultConfig {
minSdkVersion 24
targetSdkVersion 34
}
}
If these values do not match the installed SDK versions, Gradle may produce errors like Failed to find Build Tools revision 34.0.0In this case, update the components via SDK Manager or change the versions in build.gradle.
Through Android Studio|In the command line|In Gradle files|Look in the SDK folder|Another method-->
6. Alternative methods: environment variables and scripts
To automate checking the SDK version, you can use scripts or variables. environment. This is convenient in CI/CD pipelines (for example, GitHub Actions or Jenkins), where you need to dynamically obtain the version of the tools.
An example of a bash script for displaying the version Platform-Tools:
#!/bin/bashPLATFORM_TOOLS_PATH="$ANDROID_HOME/platform-tools"
if [ -f "$PLATFORM_TOOLS_PATH/source.properties" ]; then
VERSION=$(grep "Pkg.Revision" "$PLATFORM_TOOLS_PATH/source.properties" | cut -d'=' -f2)
echo "Android SDK Platform-Tools version: $VERSION"
else
echo "Platform-Tools not found at $PLATFORM_TOOLS_PATH"
fi
For Windows (PowerShell):
$platformToolsPath = "$env:LOCALAPPDATA\Android\Sdk\platform-tools"$version = Select-String -Path "$platformToolsPath\source.properties" -Pattern "Pkg.Revision=(\d+\.\d+\.\d+)"
Write-Host "Android SDK Platform-Tools version: $($version.Matches.Groups[1].Value)"
These scripts can be used integrate into build processes or use for logging versions in monitoring systems. For example, if your CI requires a specific version Build-Tools, the script will help validate the environment before launching tasks.
Automation of checking the SDK version is critical for CI/CD: even a slight version discrepancy can break the build in a cloud environment.
7. Frequent errors and their solutions
When working with versions Android SDK developers often encounter typical problems. Here are the most common ones and how to fix them:
- โ Error: "Failed to find Build Tools revision X.Y.Z"
Solution: Install the missing version viaSDK Manageror updatebuildToolsVersiontobuild.gradleto the available version. Check the list of installed versions with the commandsdkmanager --list. - โ ADB is not recognized in the terminal
Solution: Add path toplatform-toolsto variablePATHor use the full path toadb(for example/Users/username/Library/Android/sdk/platform-tools/adb). - โ Different SDK versions on the device and in the project
Solution: Make sure thattargetSdkVersioninbuild.gradlecorresponds to the Android version on the test device. For emulators, create a new one with the required API Level.
Another common problem is version conflicts when working in a team. For example, if one developer uses buildToolsVersion "33.0.0"and another. โ "34.0.0", the project can be built in different ways. To avoid this:
- Fix the SDK versions in a file
gradle.properties: - Use Gradle Wrapper with a fixed version of Gradle.
- Document the environment requirements in
README.mdproject.
ANDROID_BUILD_TOOLS_VERSION=34.0.0
ANDROID_COMPILE_SDK_VERSION=34
โ ๏ธ Attention: When updating Android Studio old versions of the SDK may be marked as outdated (ObsoleteThis does not mean that they will stop working, but Google recommends switching to the latest versions to obtain them). security fixes and new features.
FAQ: Frequently asked questions about the Android SDK version
How do I know which SDK version is needed for my project?
The SDK version depends on two factors:
- Library requirements: Check the documentation of the dependencies used (for example, Firebase or Jetpack Compose may require minimal
compileSdkVersion). - Application functionality: If you are using APIs available only in newer versions of Android (for example
Notification Channelswith API 26),targetSdkVersionmust be not lower than this version.
For new projects, it is recommended to use the latest stable version of the SDK (at the time of writing - compileSdkVersion 34 for Android 14).
Is it possible to use different versions of Build-Tools and Platform-Tools?
Yes, these components are updated independently. For example, you can have:
buildToolsVersion "33.0.0"(for compatibility with old libraries),- and
Platform-Tools 34.0.4(latest version foradbandfastboot).
However, try to avoid too large discrepancies, as this may lead to unexpected errors when building or debugging.
How to update the Android SDK to the latest version?
There are three ways:
- Via Android Studio: Open
SDK Manager(the Android robot icon in the top panel) and select components to update. - Via command line:
- Manually: Download archives from official website and unpack them into the SDK folder.
sdkmanager --update
sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
After updating, restart Android Studio and run Gradle Sync.
What to do if the SDK version is on device lower than in the project?
If minSdkVersion in your project the Android version on the device is higher, the application will simply not install.
INSTALL_FAILED_OLDER_SDK: Failed to finalize session
Solutions:
- Lower
minSdkVersioninbuild.gradle(if applicable for your application). - Update the firmware on the device (if possible).
- Use an emulator with the appropriate version of Android.
Where to find the match between the Android version and the API Level?
The official correspondence table is published by Google on the page apilevels.com or in the documentation Android Developers. Here is the current data at the time of writing:
| Android version | API Level | Code name |
|---|---|---|
| 14 | 34 | Upside Down Cake |
| 13 | 33 | Tiramisu |
| 12L | 32 | Snow Cone |
| 12 | 31 | Snow Cone |
| 11 | 30 | Red Velvet Cake |