Can't locate Android SDK installation directory for the AVD .ini file
Asked Answered
Y

4

5

I am getting this error when trying to create a new AVD:

enter image description here

This is the idea log file:

2022-04-05 14:01:12,132 [ 207201] WARN - vdmanager.AvdManagerConnection - com.android.prefs.AndroidLocationsException: Can't locate Android SDK installation directory for the AVD .ini file.

My Environment Variables are the following:

ANDROID_AVD_HOME=E:\AndroidStudioSDK

ANDROID_SDK_HOME=E:\AndroidStudioSDK

ANDROID_SDK_ROOT=E:\AndroidStudioSDK

I don´t know which .ini file is looking for.

These are the SDK platforms installed:

enter image description here

This is what I have in SDK Tools: enter image description here

I tried uninstalling and installing Android studio again with no different results.

How to fix this error?

by the way: I am not running any project, I simply want to create the Virtual Device.

Yhvh answered 5/4, 2022 at 18:13 Comment(7)
What SDK Platforms do you already have installed?Jacalynjacamar
@Jacalynjacamar I updated my question showing the SDK platforms installed.Yhvh
Thanks. Have you tried creating a new AVD by using any other SDK Platform? For example, S or PieJacalynjacamar
Thank you, I just tried Pie and S, I got the same error message.Yhvh
Okay. Is proper Android SDK location shown in a Project Structure window? (cmd+; on Mac)Jacalynjacamar
Yes, It says E:\AndroidStudioSDK.Yhvh
Let us continue this discussion in chat.Jacalynjacamar
E
11

I get same alert because set error environment variables, setting ANDROID_SDK_HOME to the .android directory may be useful, these are my environment variables:

ANDROID_AVD_HOME=D:\Android\.android\avd

ANDROID_SDK_HOME=D:\Android\.android

ANDROID_SDK_ROOT=D:\Android\Sdk

Ellissa answered 1/7, 2022 at 7:56 Comment(4)
This answer works, If anyone needs more info, please check the chat where we solve it here: chat.stackoverflow.com/rooms/243626/…Yhvh
This really wroks, thank you. Just a reminder - don't do programming in Windows (if you can)Slink
There is a typo in the value for ANDROID_AVD_HOME ("andorid").Samoyedic
The SDK_HOME and SDK_ROOT variables are deprecated. Only set the AVD_HOME. If you have problems with other variables, check this answer stackoverflow.com/a/46976475Rifkin
K
1

There are some of if's and but's here. This applies if you have uninstalled an old version of android studio and the accepted solution doesn't work; try deleting $HOME\AppData\Local\Google\AndroidStudio20XX.X

All but the latest could be deleted.

Keniakenilworth answered 2/6 at 0:20 Comment(0)
J
1

I resolved this issue just by deleting the path related to plat-form-tools of my Android Studio SDK tools and the issue was resolved.

So if you have faced this issue, you can also try to remove all paths added related to the SDK folder from Environment Variables.

Justice answered 19/6 at 10:58 Comment(0)
N
0

z.houbin answer works, thanks, I have added these environment variables:

ANDROID_AVD_HOME=C:\Users\Roman\.android\avd
ANDROID_SDK_HOME=C:\Users\Roman\.android
ANDROID_SDK_ROOT=C:\Users\Roman\AppData\Local\Android\Sdk
Nursery answered 24/7 at 12:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.