FIX: PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd

Android Studio and Emulators.

I try to occasionally make my own app in Android Studio to earn some extra money, unfortunately this has not been successful yet and I probably missed the train nowadays.

I wanted to try one of my Android applications on an emulator, but I got the following error message:

PANIC: HOME is defined but could not find Nexus_5_API_22_x86.ini file in $HOME\.android\avd (Note: avd is searched in the order of $ANDROID_AVD_HOME,$ANDROID_SDK_HOME \.android\avd and $HOME\.android\avd).
PANIC: HOME is defined but could not find Nexus_5_API_22_x86.ini file in $HOME\.android\avd (Note: avd is searched in the order of $ANDROID_AVD_HOME,$ANDROID_SDK_HOME \.android\avd and $HOME\.android\avd).

An emulator is simulating an application or system. An Android emulator for Android Studio can therefore be different phones so you can test the application well on different devices. For more about emulators, I refer you to Wikipedia.

In the tutorial below, I explain how you can solve the error message.


Let’s fix “PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd”

I have a work around and a real solution. If you use Android Studio little to nothing, you it’s best to use the work around.
If you use Android Studio for work, it is definitely better to solve the problem immediately.


Workaround

Go to your user folder and click through until you are in the folder ‘avd’.
For me this is (including Onedrive): C:\Users\wortell\OneDrive\.android\avd

PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd
PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd

Here you see all emulators that you have created. As you can see, I only have one and I prefer the workaround.
Copy the Android emulators.

Now go to C:\%usersname%\.android.avd and paste the Android emulators in this folder.

Re-start your computer and try again.


Let’s just fix “PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd” – alright.

These steps seem difficult, but if you follow it exactly, no problems should arise. We do not change system processes or something similar.

  1. Go to start
  2. search for ‘This PC’
  3. right click ‘This PC’
  4. Click ‘Properties’

PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd
PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd

Search for ‘Advanced System Settings’ on the left side of ‘system’. Click it.

PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd
PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd

The next window should be opened on the ‘Advanced’ tab. If not click ‘Advanced’ > ‘Environment Variables…’

PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd
PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd

Add a new ‘system variables‘.

PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd
PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd

Edit the System Variable: 

  • Variable name: ANDROID_SDK_HOME
  • Variable value: Add the location where they actually are. Mine is in: C:\Users\wortell\OneDrive\.android\avd
PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd
PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd

It may be that your avd directory is somewhere other than mine. Find the right place.


The complete error message

Here is the complete error message for someone looking for another part of the error message.

In the error message you see that Android Studio tries to look at a location on Onedrive.

C:\Users\Wortell\OneDrive\AppData\Local\Android\Sdk\tools\emulator.exe -avd Nexus_5_API_22_x86 -netspeed full -netdelay none PANIC: HOME is defined but could not find Nexus_5_API_22_x86.ini file in $HOME\.android\avd (Note: avd is searched in the order of $ANDROID_AVD_HOME,$ANDROID_SDK_HOME \.android\avd and $HOME\.android\avd)

Published by

Bas Wijdenes

My name is Bas Wijdenes and I work full-time as a Services Engineer. In my spare time I write about the error messages that I encounter during my work. Furthermore, I am currently occupied with Office 365, Azure infrastructure, and PowerShell for automating daily tasks.

One thought on “FIX: PANIC: HOME is defined but could not find Emulator file in $HOME\.android\avd”

Leave a Reply

Your email address will not be published. Required fields are marked *