Android studio ошибка при запуске эмулятора

It seems that «Waiting for target device to come online …» is a generic message that appears, always, when the emulator can not start properly. And what’s the cause of that? As you can see, there could be many causes.

I think the best way to find the concrete error with the emulator is to start it within a terminal. So:

1 — Open a terminal and go to this folder:~/Android/Sdk/tools

2 — Start the emulator with this command:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none

You can see the name of your (previously created with AVD Manager) emulators with this command:

./emulator -list-avds

If everything is ok, the program doesn’t start, and it writes in the terminal the concrete error.

In my case, the application says that there is a problem loading the graphic driver («libGL error: unable to load driver: r600_dri.so«). As it is explained here, it seems that Google packaged with Android Studio an old version of one library, and the emulator fails when it tries to use my graphic card.

The solution? Very easy: to use the system libraries instead of the packaged in Android Studio. How? Adding «-use-system-libs» at the end of the command. So:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none -use-system-libs

The definitive solution is to set the ANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1 for your user/system. With this change, when I run the emulator within Android Studio, it will also load the system libraries.

PS 1 — The easiest way I found to set the environment variable, it’s to modify the script that launches the Android Studio (studio.sh, in my case it is inside /opt/android-stuido/bin), and add at the beginning this:

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

PS 2 — I work with Debian Jessie and Android Studio 2.2.3. My graphic card is an ATI Radeon HD 6850 by Sapphire.

UPDATE December 2017: I had the same problem with Debian Stretch and Android Studio 3.0.1 (same graphic card). The same solution works for me.

It seems that «Waiting for target device to come online …» is a generic message that appears, always, when the emulator can not start properly. And what’s the cause of that? As you can see, there could be many causes.

I think the best way to find the concrete error with the emulator is to start it within a terminal. So:

1 — Open a terminal and go to this folder:~/Android/Sdk/tools

2 — Start the emulator with this command:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none

You can see the name of your (previously created with AVD Manager) emulators with this command:

./emulator -list-avds

If everything is ok, the program doesn’t start, and it writes in the terminal the concrete error.

In my case, the application says that there is a problem loading the graphic driver («libGL error: unable to load driver: r600_dri.so«). As it is explained here, it seems that Google packaged with Android Studio an old version of one library, and the emulator fails when it tries to use my graphic card.

The solution? Very easy: to use the system libraries instead of the packaged in Android Studio. How? Adding «-use-system-libs» at the end of the command. So:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none -use-system-libs

The definitive solution is to set the ANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1 for your user/system. With this change, when I run the emulator within Android Studio, it will also load the system libraries.

PS 1 — The easiest way I found to set the environment variable, it’s to modify the script that launches the Android Studio (studio.sh, in my case it is inside /opt/android-stuido/bin), and add at the beginning this:

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

PS 2 — I work with Debian Jessie and Android Studio 2.2.3. My graphic card is an ATI Radeon HD 6850 by Sapphire.

UPDATE December 2017: I had the same problem with Debian Stretch and Android Studio 3.0.1 (same graphic card). The same solution works for me.

In my case, after installing the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (both x86 and x64 version), the issue is solved.

But wait! Why did I know this? I will tell you my experience.

When your program meets a bug, the first thing you need to do is finding the log to debug. But where is the log file that records all the events of the Android emulator? Click Help→Show log in Explorer. And then a new window is oepned, where a file called idea.log is located, and that log file is what we are looking for.

But this file may has recorded too much verbose info, so let’s do following processes to get a more simple one:

·Exit Android Studio

·Delete the idea.log

·Open Android Studio

·Click Tools→ AVD Manerger

·Start one of emulators you have created, and needless to say, the error will occur again. But the idea.log will be created and the error is recorded into the log file now!

·Exit Android Studio.

·Open the idea.log and begin to analyze it.

·Search «emulator», and in my case there are 2 messages catching my eyes:

INFO - manager.EmulatorProcessHandler - Emulator: E:\cache\SDK\emulator\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_22 

INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code -1073741515 (0xC0000135)

Obviously, the «exit code 1073741515» is something important, and actually many people have asked what it means in StackOverFlow, but unfortunately, I can’t find any useful info about it. So let’s pass it and focus on the first message.

Open the command line (Press «Win»+»R» → Enter «CMD» → Click «OK»), copy the above message E:\cache\SDK\emulator\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_22
and paste it to the command line. Press Enter.

I totally didn’t know what this command meaned, but it’s reasonable to deduce that Android Studio ran this command and resulted in the error, so I will try to reproduce the issue.

After that, an error window pop up, saying «…VCRUNTIME140_1.dll is missing…«. I know I have been close to the answer. So I serch «VCRUNTIME140_1.dll Missing» on google, and people said that «downloading and installing both the x86 and x64 versions of the Microsoft Visual C++ 2015 — 2019 Redistributable will resolve this problem«.

So I download both the x86 and x64 version and install them. After doing this, I run the emulator again, and everything goes well.

Android Studio – эмулятор Android для ПК, имитирующий работу данной ОС. Применяется как среда для разработки мобильных приложений. Использует AVD-конфигурацию, определяющую, что нужно эмулировать: форм-фактор, обычную ОС Андроид или части ОС и варианты настроек.

Подробнее о том, что такое Android Studio, вы можете прочитать в отдельной статье, перейдя по ссылке.

Эмулятор в Android Studio не запускается

Инструкция по запуску

Рассмотрим, как запустить эмулятор Android Studio.

  • Загружаем пакет отсюда — developer.android.com/studio?hl=ru.

android studio emulator

  • Устанавливаем скачанное приложение. Важно! При загрузке выберите места для двух частей: студии и SDK (можно установить в разные папки). Для SDK нужно, чтобы на диске было свободно 6 – 8 Гб (3,2 Гб для установки и еще запас в 3-5 Гб на будущие обновления).
  • Ждем окончания загрузки SDK и установки.

android studio эмулятор android

  • Запускаем Android Studio.
  • Создаем новый проект («Start a new project»).

android studio эмулятор

  • Заполняем поля: имя, домен, расположение на диске. Выбираем версию SDK.
  • Кликаем «Finish» и ждем, пока AS будет создавать проект (1-5 минут). 

как запустить эмулятор android studio

  • Жмем вверху «AVD Manager», затем внизу слева кнопку «Create Virtual Device».

как запустить эмулятор android studio

  • Кликаем «Next», «Finish».
  • Жмем «Shift + F10».
  • Выбираем, на каком устройстве запускать готовое приложение.

android studio эмулятор не запускается

  • Настройка завершена — эмулятор готов к работе.

Возможные ошибки и методы решения

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

Рассмотрим, почему Android Studio эмулятор не запускается, и перечислим методы решения проблем.

не работает эмулятор android studio

Синхронизация Android Gradle завершилась неудачно из-за целевой версии

Необходимо проверить, установлен ли API 23. Если нет — установить через Менеджер SDK.

как запустить в андроид студио эмулятор

Класс действия {} не существует

Варианты решения.

  • Перейти в настройки модуля, затем «Flavors», «Идентификатор приложения» и добавить название пакета.
  • Установить название класса с полным путем (например: .com.example.Splash вместо .Splash).
  • Перезапустить IDE.

эмулятор для андроид студио

  • Перейти по пути: «Настройки» — «Приложения». Выбрать приложение, открыть меню переполнения (верхний угол справа) и нажать «Удалить всех пользователей». Загрузить приложение заново.
  • Перезапустить демон ADB (ввести в терминале «adb kill-server», ниже — «adb start-server»).

  • Очистить проект («Сборка» — «Чистый проект»).

запуск эмулятора android studio

Ошибка com.google.android.gms / play-services / 8.4.0 / gradle: 2.0.0-alpha5

Чтобы исправить ошибку, обновите «project/grandle.build» и дистрибутив «Grandle».

Студийный модуль Android не может найти пакет

Варианты действий.

  • Импортировать проект библиотеки по пути «File» – «New» – «Import Module». Затем посмотреть, есть ли внутри папки проекта файл «build.gradle».

  • Проверить, одинаковая ли версия плагина для Андроид (в Структуре проекта в разделе «Пакет») и у подключаемых модулей. Если различаются — сделать одинаковыми.
  • Зайти в Структуру проекта, выбрать проект слева, изменить версию плагина на «Gradle». Если синхронизация выдает ошибку, то перейти к Структуре проекта, выбрать версию плагина «Project.undo».

Тип Diamond не поддерживается

Варианты решения.

  • Перейти в «Файл» — «Структура проекта» — «Свойства». Прописать для Source Compability == 1.7, для Target Compability == 1.7.

  • Проверить версию JDK. Оператор Diamond появляется у JDK 7.
  • Обновить BuildToolsVersion и SDK.
  • В уровне языка (в настройках проекта, в разделе «Проект») выбрать вариант «Diamonds, ARM, Multi-catch etc».

android studio настройка эмулятора

Android Studio — Robolectric: android.content.res.Resources $ NotFoundException: нет такой метки com.my.app:string/app_name

Пути устранения ошибки.

  • Посмотреть, совпадает ли имя пакета с именем приложения. Если не совпадает — исправить.
  • Проверить, созданы ли и правильно ли названы каталоги, переданные приложению.

Ошибка получения родительского элемента

Чтобы исправить, проверьте, одинаковы ли версия SDK для компиляции и библиотеки поддержки. Если отличаются — исправить.

Кажется, что «Ожидание выхода целевого устройства в сеть…» — это общее сообщение, которое появляется всегда, когда эмулятор не может запуститься должным образом. И в чем причина этого? Как видите, причин может быть много.

Я думаю, что лучший способ найти конкретную ошибку с помощью эмулятора — запустить ее в терминале. Так:

1 — Откройте терминал и перейдите в эту папку: ~/Android/Sdk/tools

2 — Запустите эмулятор с помощью этой команды:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none

Вы можете увидеть имя ваших (ранее созданных с помощью AVD Manager) эмуляторов с помощью этой команды:

./emulator -list-avds

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

В моем случае приложение сообщает, что при загрузке графического драйвера возникла проблема («ошибка libGL: невозможно загрузить драйвер: r600_dri.so»). Как объясняется здесь, похоже, что Google упаковал с Android Studio старую версию одной библиотеки, и эмулятор не работает, когда он пытается использовать мою графическую карту.

Решение? Очень просто: использовать системные библиотеки вместо упакованных в Android Studio. Как? Добавление «-use-system-libs» в конце команды. Так:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none -use-system-libs

Окончательное решение — установить для переменной пользователя ANDROID_EMULATOR_USE_SYSTEM_LIBS значение 1 для вашего пользователя/системы. С этим изменением, когда я запускаю эмулятор в Android Studio, он также загружает системные библиотеки.

PS 1 — Я нашел самый простой способ установить переменную окружения, это изменить скрипт, который запускает Android Studio (studio.sh, в моем случае он находится внутри /opt/android-stuido/bin), и добавить в начале этот:

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

PS 2 — я работаю с Debian Jessie и Android Studio 2.2.3. Моя графическая карта — ATI Radeon HD 6850 от Sapphire.

ОБНОВЛЕНИЕ Декабрь 2017: У меня была та же проблема с Debian Stretch и Android Studio 3.0.1 (та же графическая карта). Такое же решение работает для меня.

Понравилась статья? Поделить с друзьями:
  • Android studio ошибка avd
  • Android studio ошибка 1812
  • Android studio unable to locate adb ошибка
  • Android studio this view is not constrained ошибка
  • Android snap ошибка