Android Emulator crashes with SIGSEGV on Ubuntu 18.04
Asked Answered
D

4

8

Android Studio version:

Android Studio 3.1.2

Build #AI-173.4720617, built on April 14, 2018

It's installed from Ubuntu's snap store. I installed the kvm using 1. Setting Up Android Studio on Ubuntu · uw-it-aca/spacescout-android Wiki. I tried what Solve Android Studio AVD issue with Ubuntu distros - cialu.net suggested, but now the lib64 folder doesn't contain libstdc++. The closest I could find is libc++.so.1, and I tried to install it using

sudo apt install libc++1

and link it similarly, but it just got my pc stuck. I also looked at the threads linked by Android emulator segmentation fault's answer but they look old..

I also tried How to solve Android Studio Emulator: libGL error on Ubuntu systems - cialu.net, but it didn't help.

I tried Android Emulator is not starting in Ubuntu's answer, using How to install the NVIDIA drivers on Ubuntu 18.04 Bionic Beaver Linux - LinuxConfig.org to install the Nvidia drivers, but still not working. This is the output from ubuntu-drivers devices:

== /sys/devices/pci0000:00/0000:00:03.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001401sv00001043sd0000854Dbc03sc00i00
vendor   : NVIDIA Corporation
model    : GM206 [GeForce GTX 960]
driver   : nvidia-driver-390 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

The only thing that worked is Android virtual device manager crashes with “double free or corruption”'s answer, but I want the hardware acceleration..

Can you please help me?

Dysthymia answered 24/6, 2018 at 15:57 Comment(1)
I've been trying to solve the same issue for a day now with no success. Have you made any progress since asking the question?Extrapolate
E
13

After days of struggle I finally got it to work. The problem for me was that even if the OS was reporting Nvidia drivers as installed that was not the case. Checking with "lshw -c video" was showing that "nouveau" was in use regardless of how I was installing Nvidia ones - command line or using "Software & Updates" GUI.

What I've done was:

  • install Ubuntu 18.04 without the option to install 3rd party software for graphics
  • disable secure boot from BIOS. This was a key part which was preventing Nvidia drivers from being installed
  • install drivers from command line with "sudo apt install nvidia-driver-390"
Extrapolate answered 28/6, 2018 at 13:9 Comment(1)
Thanks a lot, great work! I had problems debugging native code when using the software graphics, so that helped in that too!Dysthymia
L
6

Another (easy) way to fix this is to follow the driver installation instructions given here: https://askubuntu.com/a/1033498

i.e.

$ ubuntu-drivers devices
$ sudo ubuntu-drivers autoinstall

Then reboot, and use:

$ nvidia-smi

To confirm the drivers installed correctly, where the output should be something like:

Sun Feb 17 16:28:49 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.77                 Driver Version: 390.77                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro P400         Off  | 00000000:09:00.0  On |                  N/A |
| 34%   26C    P0    N/A /  N/A |    199MiB /  1997MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1107      G   /usr/lib/xorg/Xorg                            96MiB |
|    0      2646      G   ...or/qemu/linux-x86_64/qemu-system-x86_64    99MiB |
+-----------------------------------------------------------------------------+
Lardaceous answered 17/2, 2019 at 16:30 Comment(0)
S
1

In my case the SIGSEGV occurs while switching between workspaces (virtual desktops), and appears to be a bug in gnome-shell and/or gjs, as reported here on launchpad. Give this bug some heat if you're affected.

Sophia answered 11/2, 2019 at 9:10 Comment(1)
In my case it was caused from the animation between work spaces. Disabling it solved the problem askubuntu.com/a/1083797/650195Lambaste
W
-1

I downloaded a fresh version of Android Studio (AS) onto a new installation of Ubuntu 18.04 last month. I could compile my app inside AS but when I tried to run it on an emulator (Next_5X_API_27 or Pixel_2_API_24) the emulator crashed with a SEGV fault. I tried some things I saw on the web but nothing helped. I install Fedora 25 on a space hard drive but with the same result.

Then I tried attaching my smartphone to the computer via USB and entered AS. The device came up when I tried to run my app and AS installed it on the device without me asking and ran it correctly there. Now I can continue my project.

Weidner answered 20/9, 2018 at 17:23 Comment(1)
The question was about making the emulator work, I'm well aware I can use a real device, but for technical reasons, I needed the emulatorDysthymia

© 2022 - 2024 — McMap. All rights reserved.