How can I change the path to android\avd in my Android Studio-ThrowExceptions

Exception or error:

I have such exaption

InvalidPathException: Illegal char  at index 9: C:\Users\??????\.android\avd\1.avd (show balloon)

when trying to create emulator. Can I change the location of directory .android?

How to solve:
  1. Open control panel
  2. Then go to System
  3. Then go to Change Environment Variables of the User
  4. Then click create a new environment variables
  5. Create a new variable named ANDROID_SDK_HOME
  6. Set its value to your Android directory, like
    C:/users/<username>/.android

###

I tried suggested solution but did not work for me.
In my case I have to add a different variable so steps for me were:

  1. Open Control Panel
  2. Then go to System and Security
  3. Then go to System
  4. Then go to Advanced system settings
  5. Then go to Change Environment Variables of the User
  6. Then click create a new environment variables
  7. Create a new variable named ANDROID_AVD_HOME
  8. Set its value to your Android directory, like C:/users/<username>/.android

###

There is a simple way to move avd(in windows):

  1. open the directory: C:\Users\Username.android\avd, you will find the directory named with your AVD and a .ini file

  2. paste the directory to your desirable path, then change the path variable in the .ini file to the new location.

  3. start the Android studio, you will find that the AVD can work properly.

###

How can I change the path to android\avd in my Android Studio ?

Let say you want to move avd directory from it’s default C:\users\<username>\.android\avd to D:\Development\avd

  1. Move avd directory (now avd path is D:\Development\avd)
  2. Change or add environment variable ANDROID_AVD_HOME : D:\Development\avd

    modify environment variable on Windows:

    Control Panel > System > Advanced system settings > Environment Variables

  3. If you have already AVD, change avdName.ini to D:\Development\avd\avdName (example D:\Development\avd\Nexus_S_API_22.avd)

Leave a Reply

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