programing tip

안드로이드 SDK 위치

itbloger 2020. 7. 4. 11:09
반응형

안드로이드 SDK 위치


Xamarin Studio가 있으며 Android SDK 위치를 지정해야합니다. 나는 이전에 Xamarin Studio가 내 PC에서 작업하고 있었으므로 어떤 이유로 든 다시 입력해야합니다.

다음 위치를 입력했습니다 :

C:\Users\**username**\AppData\Local\Android\android-sdk

Xamarin Studio는이 위치를 허용하지 않으며 다음 메시지를 표시합니다.

No SDK found at the specified location

이 위치에는 플랫폼 도구 및 기타 SDK 폴더가 있습니다.

왜 이것이 작동하지 않으며 어떻게해야합니까?


폴더 내용의 화면이 있습니까? 이것은 내 설정입니다.

사 마린

폴더

이 스크린 샷이 도움이 되길 바랍니다.


v3.3 업데이트

여기에 이미지 설명을 입력하십시오

최신 정보:

Android Studio 3.1 업데이트에서 일부 아이콘 이미지가 변경되었습니다. Android Studio에서이 아이콘을 클릭하십시오.

여기에 이미지 설명을 입력하십시오

실물:

Android SDK 관리자 용 Android Studio에서이 아이콘을 클릭하십시오.

여기에 이미지 설명을 입력하십시오

그리고 당신의 안드로이드 SDK 위치는 여기에있을 것입니다 여기에 이미지 설명을 입력하십시오


Android SDK 경로는 일반적으로 C:\Users\<username>\AppData\Local\Android\sdk입니다.


Try to open the Android Sdk manager and the path would be displayed on the status bar.

여기에 이미지 설명을 입력하십시오


If you only installed Xamarin with Visual Studio setup, the android SDK location is :

C:\Program Files (x86)\Android\android-sdk

You can find it in Android SDK Manager as said Raj Asapu

In visual Studio : Visual Studio의 Android SDK 관리자

Note : you should not use Program Files path to install Android Studio due to the space in path ! Xamarin 이후 Android Studio 설정


The default location for Android sdk(s) on a Mac is:

/Users/*username*/Library/Android/sdk


The question doesn't seem to require a programmatic solution, but my Google search brought me here anyway. Here's my C# attempt at detecting where the SDK is installed, based on the most common installation paths.

static string FindAndroidSDKPath()
{
    string uniqueFile = Path.Combine("platform-tools", "adb.exe"); // look for adb in Android folders
    string[] searchDirs =
    {
        // User/AppData/Local
        Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
        // Program Files
        Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
        // Program Files (x86) (it's okay if we're on 32-bit, we check if this folder exists first)
        Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + " (x86)",
        // User/AppData/Roaming
        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
    };
    foreach (string searchDir in searchDirs)
    {
        string androidDir = Path.Combine(searchDir, "Android");
        if (Directory.Exists(androidDir))
        {
            string[] subDirs = Directory.GetDirectories(androidDir, "*sdk*", SearchOption.TopDirectoryOnly);
            foreach (string subDir in subDirs)
            {
                string path = Path.Combine(subDir, uniqueFile);
                if (File.Exists(path))
                {
                    // found unique file at DIR/Android
                    return subDir;
                }
            }
        }
    }
    // no luck finding SDK! :(
    return null;
}

I need this because I'm writing an extension to a C# program to work with Android Studio/Gradle. Hopefully someone else will find this approach useful.


If you can run the "sdkmanager" from the command line, then running sdkmanager --verbose --list will reveal the paths it checks.

For example, I have installed the SDK in c:\spool\Android and for me running the sdkmanager --verbose --list looks like:

여기에 이미지 설명을 입력하십시오

>sdkmanager --list --verbose
Info: Parsing c:\spool\Android\build-tools\27.0.3\package.xml
Info: Parsing c:\spool\Android\emulator\package.xml
Info: Parsing c:\spool\Android\extras\android\m2repository\package.xml
Info: Parsing c:\spool\Android\extras\intel\Hardware_Accelerated_Execution_Manager\package.xml
Info: Parsing c:\spool\Android\patcher\v4\package.xml
Info: Parsing c:\spool\Android\platform-tools\package.xml
Info: Parsing c:\spool\Android\platforms\android-27\package.xml
Info: Parsing c:\spool\Android\tools\package.xml
Installed packages:=====================] 100% Computing updates...
--------------------------------------
build-tools;27.0.3
    Description:        Android SDK Build-Tools 27.0.3
    Version:            27.0.3
    Installed Location: c:\spool\Android\build-tools\27.0.3

P.S. On another PC I let the Android Studio install the Android SDK for me, and the SDK ended up in C:\Users\MyUsername\AppData\Local\Android\Sdk.


Have you tried to find this folder via the Windows explorer? Can it been seen? Maybe the folder is hidden (by default install - it is hidden by the Windows operating system in the users folder). Just check that you can view hidden folders in Windows explorer (by the settings in the windows control panel > appearance and personalization > folder options > show hidden files and folders.

This happened to me as the Windows OS could not find the SDK folder which was required for the Android Studio SDK path, and was resolved by showing hidden files and folders, which enabled me to complete the default SDK install path location.


If you have downloaded sdk manager zip (from https://developer.android.com/studio/#downloads), then you have Android SDK Location as root of the extracted folder.

So silly, But it took time for me as a beginner.


On 28 April 2019 official procedure is the following:

  1. Download and install Android Studio from - link
  2. Start Android Studio. On first launch, the Android Studio will download latest Android SDK into officially accepted folder
  3. When Android studio finish downloading components you can copy/paste path from the "Downloading Components" view logs so you don't need to type your [Username]. For Windows: "C:\Users\ [Username] \AppData\Local\Android\Sdk"

press WIN+R and from the run dialog run dialog Execute the following: **%appdata%..\Local\Android**

You should now be presented with Folder Explorer displaying the parent directory of the SDK.


C : \ Users \ username \ AppData \ Local \ Android \ sdk에서 찾았습니다.

참고 URL : https://stackoverflow.com/questions/25176594/android-sdk-location

반응형