Your android sdk location cannot be at the filesystem root

How to Fix “SDK location not found” in Android Studio?

Google developed Android SDK which is a Software Development Kit developed by Google for the Android platform. You can create Android apps using Android SDK, and you don’t need to be an expert to use it. Android SDK and Android Studio come bundled together, with Google’s official integrated development environment (IDE) for the Android operating system.

In this article, we see how to fix an error that is related to the main Android building component of Android Studio that is the Android SDK. The most common error related to Android SDK is “SDK location not found“. This message pops up stating that the location of Android SDK was not detected when the path of SDK is assigned incorrectly. There can also be other reasons for this error message as well and we will see ways to get rid of this error.

When switching from one IDE to another (Like from Eclipse to Android Studio)

Method 1

In this case, follow the below steps:

Method 2

In case the above procedure doesn’t work then add the ANDROID_HOME variable in “Environment Variables” as C:\Users\Username\AppData\Local\Android\Sdk.

Method 3

In case it does not work even then, then you need to change the directory path on Project Structure as well.

  • Close the current project and you’ll see a pop-up with a dialog which will then proceed to Configure option.
  • Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local.properties and select Valid Target.

Method 4

A settings.gradle file might be missing from the project. Make sure that the file exists from the project you are importing. If not add the settings.gradle file with the following:

Save the file and put it in the top-level folder in your project.

Источник

Где находится android_sdk_root? И как его установить?

Я установил android_sdk_home, чтобы мое приложение могло найти .android при попытке запустить. Теперь я получаю сообщение об ошибке, указывающее, что android_sdk_root не определен. Я запускаю win 7, новую установку Android-студии, внутри параллелей на macbook pro.

Благодарю за ваш ответ. Я проверил местоположение, и он идентифицирован как то же место, что и путь среды ANDROID_SDK_HOME. Он все еще говорит, что root не определен. Я создал путь окружения ANDROID_SDK_ROOT к тому же местоположению, и он все еще не определен.

Android_sdk_root – системная переменная, указывающая на корневую папку инструментов android sdk. Вероятно, вы получите ошибку, потому что переменная не установлена. Чтобы установить его в Android Studio, перейдите по ссылке:

  1. Файл -> Структура проекта в структуре проекта
  2. Слева -> местоположение SDK
  3. Местоположение SDK выберите местоположение Android SDK

Если вы установили SDK для Android, обратитесь к этому ответу, чтобы найти путь к нему: https://stackoverflow.com/a/15702396/3625900

Я получил ту же ошибку после установки студии Android и попытался запустить мир привет. Я думаю, вам нужно использовать SDK Manager внутри Android Studio, чтобы сначала установить некоторые вещи.

Читайте также:  Лаунчер для андроид трешбокс

Откройте Android Studio и нажмите на Диспетчер SDK на панели инструментов.

Теперь установите необходимые инструменты SDK.

  • Инструменты -> Android SDK Tools
  • Инструменты -> Android SDK Platform-tools
  • Инструменты -> Android SDK Build-tools (самая высокая версия)

Для каждого выпуска Android, на который настроен таргетинг, нажмите соответствующую папку Android XX и выберите (как минимум):

  • Платформа SDK
  • Системное изображение для эмулятора, такое как ARM EABI v7a System Image

Менеджер SDK будет запускаться (это может занять некоторое время) и загрузить и установить различные SDK.

Внутри Android Studio, File-> Project Structure покажет вам, где установлены ваши Android-устройства. Как вы видите, мой – это c: \ users \ Joe \ AppData \ Local \ Android \ sdk1.

Если я перейду к C: \ Users \ Joe \ AppData \ Local \ Android \ sdk1 \ sources, вы сможете увидеть различные Android SDK, установленные там …

Источник

X Unable to locate Android SDK. #13078

Comments

sjx19900424 commented Nov 18, 2017

X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.

I have installed Android SDK ,and set $ANDROID_HOME. But ‘flutter doctor’ show the error again.

The text was updated successfully, but these errors were encountered:

bledfort commented Feb 24, 2018

Same issue, why there is no responses? weird

sam43 commented Feb 27, 2018

same issue. stucked. Help!

DevXtreme0 commented Feb 27, 2018 •

try to Install Android studio again, with default installation folder. OR now I found a way to solve this problem .. this is the way i solved this issue:

(Reminder — before doing below steps make sure you already setup environment variable for flutter doctor like , variable name as «Path » variable value as «flutter\bin;» )

1st go to Control Panel -> click User Accounts -> again click User Account -> you can see option called «change my environment variables» click it -> in popup small window click NEW and type variable name as ANDROID_HOME variable value as «your Android SDK Location » Example : «Partition Letter:\AndroidStudioSDK» , Save this settings.
After that go to the windows power shell type flutter doctor and click enter, you can see some results.

sam43 commented Feb 28, 2018

Wow, this worked perfectly, thank you. but I can’t able start any device to run the sample project. Can you help me with this last thing please? here is the attachment.

@PillowDeveloper

sam43 commented Feb 28, 2018 •

Update. working fine. But have to start the project from PowerShell and run it. Note: Close your AS 3.0 if it is running. steps: create app -> cd -> flutter run. Boom! Happy coding. 🙂

AbderrahmeneDZ commented May 15, 2018 •

I had the same problem,
I did the following steps :

*/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor

this should work on windows

sumiaggarwal commented May 27, 2018

thanks worked like a charm 🙂

zoechi commented Aug 3, 2018

@sjx19900424 is this still an issue or can this be closed?

mahbobyosf commented Aug 28, 2018

This worked perfectly, thank you.

arsalan0312 commented Sep 5, 2018

I have the same issue after following step.
/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor

zoechi commented Sep 5, 2018

check the SDK config in android/local.properties
You can use flutter config to update it.
Can you still reproduce when the setting is updated to the new path?

zoechi commented Oct 8, 2018

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don’t hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Читайте также:  Головное устройство сузуки гранд витара андроид

JosephDunivan commented Dec 5, 2018

check the SDK config in android/local.properties
You can use flutter config to update it.
Can you still reproduce when the setting is updated to the new path?

@zoechi When you say «You can use flutter config to update it.» can you elaborate? The issue is flutter expects the path to point to /usr/local/share/android-sdk, however android studio installs everything in users//library/android/sdk and has for quite some time. The issue seems to be that redirecting this expected path to the actual path in .bash_profile does not solve the issue.

JosephDunivan commented Dec 5, 2018 •

Using the command flutter config —android-sdk $HOME/Library/Android/sdk on Mac OS seems to have immediately solved my issues if anyone is looking for a more specific directive.

QuietLakeStone commented Dec 15, 2018

I finally solved the problem. >>Ubuntu 18 android-ndk-r16b-linux-x86_64.zip
Then modify the environment and AS configure,restart AS,no devices ->Android Device
I hope I can help you all.

DevLuuk commented Jan 8, 2019 •

I solved it on Ubuntu by adding this line: flutter config —android-sdk /path/to/android/sdk in the terminal in Android Studio.

Qinxianshen commented Jan 30, 2019

I had the same problem,
I did the following steps :

*/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor

this should work on windows

awesome ! It‘s work for me!Thank you

ValmirJuniorr commented Mar 20, 2019

I solved it on Ubuntu by adding this line: flutter config —android-sdk /path/to/android/sdk in the terminal in Android Studio.

it works perfect to me, thanks buddy.

codingcity4747 commented Mar 20, 2019

I had the same problem,
I did the following steps :

*/ Open system properties
*/ Environment variables
*/ create new system variable
*/ name : ANDROID_HOME
*/ value : copy your SDK path
*/ close your current cmd, and restart it
*/ run flutter doctor

this should work on windows

this worked for me, but I mention that after adding ANDROID_HOME path to your env variables you should restart your computer before checking flutter doctor report
good luck

DaywisonSilva commented Sep 5, 2019

[X] Android toolchain — develop for Android devices
X ANDROID_HOME = C:\Users\Daywi\AppData\Local\Android\Sdk
but Android SDK not found at this location.

avavirus3 commented Mar 18, 2020 •

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-US)
[!] Android toolchain — develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.

[!] Android Studio (not installed)
[!] IntelliJ IDEA Community Edition (version 2018.2)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.41.1)
[!] Connected device
! No devices available

Источник

PANIC: Разбитый путь системы AVD. Проверьте значение ANDROID_SDK_ROOT

После того, как набрав кордову, запустите андроид в терминале, я получаю эту ошибку …

Это происходит после экспорта,

Перед экспортом я получил,

Любые идеи, в которых я ошибаюсь? Я уверен, что это корень sdk, так почему я получаю сломанный системный путь avd?

Это означает, что ваш путь к инструментам неверен. Это то, что похоже на Mac с использованием варева. Обратите внимание на версию.

В вашем случае похоже, что вы должны запустить это:

При перемещении вашего AVD или SDK в другой каталог может возникнуть несколько различных проблем или заменить старый SDK на новый или каким-то образом получить SDK поврежден.

Ниже я опишу все возможные проблемы, которые я знаю, и дам вам несколько способов их решения.

Конечно, я предполагаю, что у вас есть AVD, и он находится в C:\Users\ \.android\avd (Windows) или

/.android/avd (Linux / MacOS).

Если вы переместили .android в другое место, установите ANDROID_SDK_HOME среды ANDROID_SDK_HOME в путь родительского .android содержащего ваш .android и убедитесь, что AVD Manager успешно нашел ваше виртуальное устройство.

Читайте также:  Андроид не удалось записать

Также проверьте пути в /.android/avd/.ini

Неполная / поврежденная структура SDK

Эти 2 ошибки происходят, если эмулятор не может найти SDK, или SDK сломан. Поэтому, прежде всего, я рекомендую удалить переменную ANDROID_SDK_ROOT . Это необходимо только тогда, когда эмулятор расположен за пределами каталога SDK. Но в общем, ваш эмулятор остается внутри SDK-каталога. И в этом случае он должен автоматически определять местоположение SDK. Если это не так, ваш SDK, вероятно, имеет неправильный файл. Пожалуйста, сделайте следующее:

Убедитесь, что в каталоге SDK есть как минимум эти 4 каталога: emulator , platforms , platform-tools , system-images . Это очень важно! Эти каталоги должны присутствовать. Если некоторые из них не существуют, то просто создавайте пустые директории.

Если все настроено правильно, когда эти ошибки об ANDROID_SDK_ROOT должны исчезнуть. Если это не так, то теперь вы можете попытаться настроить переменную ANDROID_SDK_ROOT .

Необходимые пакеты и HAXM не установлены

Следующая проблема, с которой вы можете столкнуться, заключается в том, что эмулятор начинает запускаться, но сразу же завершает работу или завершает работу. Вероятно, это означает, что у вас не установлены все необходимые пакеты.

Другая возможная ошибка:

Не удалось автоматически определить двоичный файл ADB. Некоторые функциональные возможности эмулятора не будут работать, пока пользовательский путь к ADB не будет добавлен на странице расширенных настроек.

Таким образом, чтобы успешно запустить любой AVD, вы должны быть уверены, что по крайней мере эти пакеты установлены:

И, как я упоминал ранее, вы должны установить системные образы, которые использует ваш AVD, например, system-images;android-25;google_apis;x86

Обратите внимание, что в последних версиях SDK нет автономного SDK Manager.exe . Вместо этого вам нужно либо использовать Android Studio, либо tools\bin\sdkmanager.bat (у Linux / MacOS, вероятно, есть файлы sh ).

Чтобы перечислить все доступные пакеты, используйте sdkmanager —list или sdkmanager —list —verbose

Для установки пакетов используйте sdkmanager

Также я рекомендую установить HAXM в вашей системе вручную.

Qcow2-файлы относятся к неправильным / несуществующим базовым изображениям

Последняя проблема, о которой я расскажу, происходит, когда вы пытаетесь переместить AVD или SDK с одного компьютера или каталога на другой. В этом случае вы можете получить такую ​​ошибку:

Qemu-system-i386.exe: -drive if = none, overlap-check = none, cache = unsafe, index = 0, file = C:\Users\

    \.android\avd\ .

Avd \ system.img.qcow2, только для чтения: не удалось открыть файл резервной

    \system-images\android-22\google_apis\x86\system.img : не удалось открыть ‘
      \system-images\android-22\google_apis\x86\system.img ‘: недопустимый аргумент

    Есть два способа исправить это:

    Если вам не qcow2 данные, содержащиеся в AVD, просто удалите все файлы qcow2 из каталога AVD (например, из /.android/avd/ ). В этом случае вы получите чистую версию Android, например, после жесткого сброса.

    Если данные на эмуляторе важны для вас, то каждый qcow2 открывайте все файлы qcow2 с помощью любого редактора HEX (я предпочитаю HxD ), найдите путь к базовому файлу img и измените его на правильный в режиме Overwrite ( Для сохранения размера файла). Затем выберите путь и получите его длину в шестнадцатеричном виде (например, 2F ). 2F представляет косую черту ASCII. Поместите его в положение 13 :

    PS: Не уверен, но, вероятно, есть некоторые утилиты, такие как qemu-img, позволяющие устанавливать разные базовые изображения. Ну, мне проще вручную отредактировать двоичный файл.

    Теперь вы, вероятно, сможете успешно запустить Android-устройство Android. Я надеюсь, что это так 🙂

    Хорошо, я могу запустить Android от кордовы, я изменил ANDROID_HOME,

    Вы должны добавить AVD эмулятор. Перейти к следующему местоположению:

    Запустите AVD Manager и на второй вкладке (Device Definitions) нажмите кнопку «createAVD».

    Решение с созданием Virtual Device помогает мне в моем случае с Ionic в Windows 10. PANIC: Не удается найти путь к системе AVD. Пожалуйста, определите ANDROID_SDK_ROOT

    Проверьте, загружено ли системное изображение, используемое вашим AVD, в формате $ANDROID_SDK_ROOT/system-images/

    На Mac: я установил android-sdk используя brew а также Android Studio. Так или иначе, наличие двух установок вызывало эту проблему. Когда я удалил свою установку на кипке sdk с помощью brew cask uninstall android-sdk и добавьте следующие vars к моему env. Это сработало.

    export ANDROID_HOME=/Users/ /Library/Android/sdk export ANDROID_SDK_ROOT=$ANDROID_HOME

    В моем случае это было нарушено, потому что ANDROID_HOME и ANDROID_SDK_ROOT были разными, поэтому, когда я установил ANDROID_HOME, чтобы он был таким же, как ANDROID_SDK_ROOT, он начал работать.

    У меня такая же проблема. Я удалил эмулятор изображения в папку .android / avd и после установки lib32stdc ++ 6:

    Источник

Оцените статью