AVD
Android SDK
troubleshooting
system path error
development environment

PANIC Broken AVD system path. Check your ANDROID_SDK_ROOT value

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value means the Android emulator cannot find the SDK files or system image referenced by the virtual device. The fix is usually not reinstalling everything, but making the SDK path, emulator, and AVD configuration agree with each other.

What The Error Usually Means

The emulator expects to find three things:

  • the Android SDK root directory
  • the system image installed under that SDK
  • an AVD configuration pointing to a valid image

If one of those is missing or points to an old location, startup fails with the panic message.

Typical causes are:

  • 'ANDROID_SDK_ROOT points to the wrong directory'
  • the SDK was moved after the AVD was created
  • the required system image is not installed
  • old config.ini entries inside the AVD still reference deleted files
  • 'ANDROID_HOME and ANDROID_SDK_ROOT disagree'

Verify The SDK Location First

Start by checking where the SDK actually lives.

On macOS or Linux:

bash
echo "$ANDROID_SDK_ROOT"
echo "$ANDROID_HOME"
ls "$ANDROID_SDK_ROOT"

On Windows PowerShell:

powershell
$env:ANDROID_SDK_ROOT
$env:ANDROID_HOME
dir $env:ANDROID_SDK_ROOT

A valid SDK root usually contains directories such as emulator, platform-tools, platforms, and system-images.

If the variable is empty or wrong, set it to the real SDK directory. On many macOS installations that is under ~/Library/Android/sdk, while on Windows it is often under %LOCALAPPDATA%\Android\Sdk.

Confirm That The System Image Exists

Even with the correct SDK root, the selected image may be missing.

bash
sdkmanager --list | grep system-images
emulator -list-avds

If the AVD requires, for example, an Android 34 Google APIs x86_64 image, that package must exist under the SDK root. If it does not, install it from Android Studio SDK Manager or with sdkmanager.

bash
sdkmanager "system-images;android-34;google_apis;x86_64"

Then recreate or update the AVD.

Recreate The Broken AVD If Needed

Sometimes the fastest fix is to delete the broken AVD and create a new one using the current SDK paths.

bash
1avdmanager list avd
2avdmanager delete avd -n Pixel_Test
3avdmanager create avd -n Pixel_Test \
4  -k "system-images;android-34;google_apis;x86_64"

This removes stale references inside the old AVD definition. If you prefer to inspect instead of recreating, check the AVD directory under ~/.android/avd and open the config.ini file.

Look for old absolute paths that still point to a removed SDK location.

Check For Mixed Environment Variables

Older tooling often used ANDROID_HOME; newer tooling prefers ANDROID_SDK_ROOT. The safest setup is consistency.

If both variables are set, point them to the same directory or remove the obsolete one from your shell profile and IDE configuration. A mismatched setup can make one tool resolve the emulator correctly while another tool resolves sdkmanager or avdmanager differently.

A clean shell configuration on macOS or Linux looks like this:

bash
export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
export PATH="$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/platform-tools:$PATH"

After editing shell startup files, open a new terminal or reload the profile.

Use Android Studio To Cross-Check

If command-line tools still fail, open Android Studio and verify:

  • 'SDK Manager shows the expected SDK location'
  • the emulator package is installed
  • the required system image is installed
  • 'Device Manager can create a new virtual device'

If Android Studio sees a different SDK directory than your terminal, the environment configuration is still inconsistent.

Common Pitfalls

The most common mistake is setting ANDROID_SDK_ROOT to the platform-tools directory instead of the SDK root. The variable must point to the top-level SDK folder.

Another common problem is moving the SDK directory manually after creating AVDs. Existing AVD definitions may keep absolute paths that no longer exist.

Developers also waste time reinstalling Android Studio when the real issue is just a missing system image package.

Finally, if sdkmanager, avdmanager, and emulator come from different installations, troubleshooting becomes confusing quickly. Make sure the command-line tools and the SDK belong to the same installation.

Summary

  • Verify that ANDROID_SDK_ROOT points to the real SDK root.
  • Check that the required system-images package is installed.
  • Recreate the AVD if its config still references stale paths.
  • Keep ANDROID_HOME and ANDROID_SDK_ROOT consistent.
  • Confirm that Android Studio and the terminal are using the same SDK directory.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

All Rights Reserved.