PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT (in windows 10)

后端 未结 14 2550
深忆病人
深忆病人 2020-12-15 02:15

While running an app on the virtual device (AVD) created on Android studio (in Windows 10), I am getting an error and panic.

<

相关标签:
14条回答
  • 2020-12-15 03:05

    Try to use the argument: -sysdir <Your_SDK_DIR> and then check whether the error message displayed.

    See also: https://android.googlesource.com/platform/external/qemu/+/1a15692cded92d66dea1a51389a3c4b9e3b3631a/android/emulator/main-emulator.cpp

    Check out these clip you will find out the reason:

    // Sanity checks.
    if (avdName) {
        if (!isCpuArchSupportedByRanchu(avdArch)) {
            APANIC("CPU Architecture '%s' is not supported by the QEMU2 emulator, (the classic engine is deprecated!)",
                   avdArch);
        }
        std::string systemPath = getAvdSystemPath(avdName, sysDir);
        if (systemPath.empty()) {
            const char* env = getenv("ANDROID_SDK_ROOT");
            if (!env || !env[0]) {
                APANIC("Cannot find AVD system path. Please define "
                       "ANDROID_SDK_ROOT\n");
            } else {
                APANIC("Broken AVD system path. Check your ANDROID_SDK_ROOT "
                       "value [%s]!\n",
                       env);
            }
        }
    }
    

    Then if you see emulator: ERROR: can't find SDK installation directory, please check this solution. Android emulator errors with "emulator: ERROR: can't find SDK installation directory"

    0 讨论(0)
  • 2020-12-15 03:10

    Check C:\Users\User path. Change User directory name (may be something different name) from your alphabet to English alphabet. Warning: it is dangerous operation, learn it before changing. Android Studio can not access to AVD throw users\Your alphabet name\.android.

    0 讨论(0)
  • 2020-12-15 03:11

    In Korean version of Windows 10, this problem happened because my Windows user name was in Korean not in English. After the user name was made again in English, the problem was cleared.

    0 讨论(0)
  • 2020-12-15 03:15

    I had the same problem when I was trying to move the android studio to another Drive as it was taking a lot of space in my C(Windows drive) Drive, Here's what fixed my problem:-

    1. Copy the C:\Users\ #YourUserName\ .android folder to another drive,
    2. Go to start environment variable make a new variable named ANDROID_SDK_HOME and add the path of the new location like mine is F:\Android AVD( don't add .android to it )
    3. Then add ANDROID_SDK_HOME to the existing Path variable.
    4. Open android studio, go to configure --> AVD manager and you'll see that you've successfully moved to a new location.
    0 讨论(0)
  • 2020-12-15 03:15

    Update Android emulator alone from SDK tool

    0 讨论(0)
  • 2020-12-15 03:16

    define ANDROID_SDK_ROOT as environment variable where your SDK is residing, default path would be "C:\Program Files (x86)\Android\android-sdk" and restart computer to take effect.

    0 讨论(0)
提交回复
热议问题