The 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
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 location
I have Xamarin Studio, and I need to specify the Android SDK Location. I have previously had Xamarin Studio working on my pc, and for some reason, I need to enter this again.
I have entered the following location:
Xamarin Studio does not accept this location and displays the following message:
This location has platform-tools and other SDK folders.
Why is this not working, and what should I do?
16 Answers 16
Update v3.3
Update:
Android Studio 3.1 update, some of the icon images have changed. Click this icon in Android Studio.
Original:
Click this icon in Android Studio for the Android SDK manager
And your Android SDK Location will be here
Do you have a screen of the content of your folder? This is my setup:
I hope these screenshots can help you out.
Try to open the Android Sdk manager and the path would be displayed on the status bar.
The default location for Android sdk(s) on a Mac is:
If you only installed Xamarin with Visual Studio setup, the android SDK location is :
You can find it in Android SDK Manager as said Raj Asapu
On 28 April 2019 official procedure is the following:
When you first time install Android Studio Setup, you can also see the SDK folder. For me it is:
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.
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.
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.
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.
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.
Where is android_sdk_root? and how do I set it.?
Thank you for your response. I checked the location and it is identified as the same location as the ANDROID_SDK_HOME environment path. It still says root is undefined. I created an ANDROID_SDK_ROOT enviroment path to the same location and it is still undefined.
15 Answers 15
This is how I did it on macOS:
And added the following environment variables:
Android path might be different, if so change it accordingly. At last, to refresh the terminal to apply changes:
I received the same error after installing android studio and trying to run hello world. I think you need to use the SDK Manager inside Android Studio to install some things first.
Open up Android Studio, and click on the SDK Manager in the toolbar.
Now install the SDK tools you need.
For each Android release you are targeting, hit the appropriate Android X.X folder and select (at a minimum):
The SDK Manager will run (this can take a while) and download and install the various SDKs.
Inside Android Studio, File->Project Structure will show you where your Android sdks are installed. As you can see mine is c:\users\Joe\AppData\Local\Android\sdk1.
If I navigate to C:\Users\Joe\AppData\Local\Android\sdk1\sources you can see the various Android SDKs installed there.
ПАНИКА: Сломанный путь системы AVD. Проверьте значение ANDROID_SDK_ROOT
После ввода cordova run android в терминале я получаю эту ошибку:
Это происходит после экспорта:
Перед экспортом я получил:
Есть идеи, где я иду не так? Я уверен, что это корень SDK, так почему я получаю сломанный системный путь AVD?
При перемещении AVD или SDK в другой каталог или при замене старого SDK новым или при повреждении SDK может возникнуть несколько разных проблем.
Ниже я опишу все возможные проблемы, которые я знаю, и дам несколько способов их решения.
Конечно, я предполагаю, что у вас есть созданный AVD, и он находится в C:\Users\ \.android\avd (Windows) или
/.android/avd (Linux / MacOS).
Также проверьте пути в /.android/avd/.ini
Неполная / поврежденная структура SDK
Эти 2 ошибки происходят, если эмулятор не может найти SDK или SDK поврежден.
Если все настроено правильно, когда эти ошибки о ANDROID_SDK_ROOT должны исчезнуть. Если это не так, то теперь вы можете попытаться установить ANDROID_SDK_ROOT переменную.
Обязательные пакеты и HAXM не установлены
Следующая проблема, с которой вы можете столкнуться, заключается в том, что эмулятор начинает запускаться, но зависает или сразу же завершает работу. Это, вероятно, означает, что у вас не установлены все необходимые пакеты.
Другая возможная ошибка:
Не удалось автоматически обнаружить двоичный файл ADB. Некоторые функции эмулятора не будут работать, пока на странице расширенных настроек не будет добавлен пользовательский путь к ADB.
Итак, чтобы успешно запустить любой AVD, вы должны быть уверены, что установлены хотя бы следующие пакеты:
И, как я упоминал ранее, вы должны установить образы системы, которые использует ваш AVD, например system-images;android-25;google_apis;x86
Для установки пакетов используйте sdkmanager
Также я рекомендую установить HAXM на вашу систему вручную.
Qcow2-файлы ссылаются на неправильные / несуществующие базовые образы
Последняя проблема, о которой я упомяну, возникает, когда вы пытаетесь переместить AVD или SDK с одного компьютера или каталога на другой. В этом случае вы можете получить такую ошибку:
avd \ system.img.qcow2, только для чтения: не удалось открыть файл поддержки: не удалось открыть ‘
- \system-images\android-22\google_apis\x86\system.img ‘: неверный аргумент
Есть 2 способа это исправить:
Если вас не волнуют данные, которые содержит AVD, просто удалите все qcow2 файлы из каталога AVD (например, из /.android/avd/ ). В этом случае вы получите чистую версию Android, как после полной перезагрузки.
PS: Не уверен, но, вероятно, есть некоторые утилиты, такие как qemu-img, позволяющие установить другое базовое изображение. Ну, мне проще редактировать бинарный файл вручную.
Теперь вы, вероятно, сможете успешно запустить виртуальное устройство Android. Я надеюсь, что это так 🙂
На Mac: я установил android-sdk с использованием, brew а также Android Studio. Каким-то образом наличие 2 установок было причиной этой проблемы. Когда я удалил мою установку brew sdk, используя brew cask uninstall android-sdk и добавил следующие переменные в мою среду. Это сработало.
Это решит вашу проблему в macOS:
Устранение ошибки при использовании Android SDK от Homebrew в качестве SDK по умолчанию
Как и @EFreak, я установил android-sdk с помощью homebrew (менеджер пакетов для Mac). Мне нужно было сделать следующее, чтобы исправить ошибку, потому что я следовал инструкциям по nativescript и столкнулся с ошибкой. Если вы мне нравитесь, намеревайтесь использовать версию brew вместо версии android-sdk, используйте этот ответ (это позволит вам использовать tns run android api nativescripts ), и если вы хотите, чтобы android studio по умолчанию android-sdk следовал ответу @ EFreak.
Настройка Android Studio для использования Android SDK Homebrew
В основном вам просто нужно изменить расположение Android SDK в Android Studio. Сначала откройте проект в андроид студии. Затем откройте SDK Manager, нажав эту кнопку.
Затем, когда появятся настройки по умолчанию для менеджера Android SDK, вам нужно нажать «Изменить» рядом с расположением Android SDK.
Поиск местоположения Android SDK от Homebrew
Значение переменной export ed ANDROID_SDK_ROOT (которая здесь есть /usr/local/share/android-sdk ) является местоположением доморощенного андроида SDK.
Затем вам нужно нажать кнопку «Расположение Android SDK» (обозначенную на рисунке как «1») и вставить в Android SDK Homebrew.
Затем просто завершите работу мастера, установив все пакеты. На этом этапе мне нужно было удалить и воссоздать эмуляторы моего устройства, но после этого все работало отлично.
Установка переменных среды Android SDK для указания на Android SDK от Homebrew
Если вам нужно изменить значения ANDROID_HOME и ANDROID_SDK_ROOT, вы можете сделать это в настройках своего профиля на вашем Mac, которые, вероятно, будут выглядеть примерно как
Вам нужно изменить значения обоих экспортов на правильные значения местоположения Android SDK Homebrew, а затем сохранить файл. Чтобы убедиться, что правильные значения были записаны, вы должны сначала либо закрыть и открыть свой терминал, который должен перезапустить файл и сбросить переменные среды, либо вы можете получить файл, запустив source
Где можно задать свои расположения пакета SDK для Android?
Расположение по умолчанию для каждого пути выглядит следующим образом:
Расположение пакета средств разработки Java:
C:\Program Филес\жава\ jdk1.8.0_131
Расположение пакета SDK для Android
C:\Program Files (x86) \Андроид\андроид-СДК
Расположение пакета Android NDK:
C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b
Обратите внимание, что номер версии NDK может отличаться. Например, вместо android-ndk-r13b может быть более ранняя версия, например android-ndk-r10e.
в Visual Studio для Mac перейдите к параметрам проекты > расположение пакета SDK для > Android. На странице Android перейдите на вкладку Расположения, чтобы просмотреть и задать расположение пакета SDK:
Расположение по умолчанию для каждого пути выглядит следующим образом:
Расположение пакета SDK для Android
Расположение пакета Android NDK:
Расположение пакета SDK для Java (JDK):
Обратите внимание, что номер версии NDK может отличаться. Например, вместо android-ndk-r14b может быть более ранняя версия, например android-ndk-r10e.