Page MenuHomeSolus

Android Studio Emulator Error
Closed, ResolvedPublic

Description

The package points the AVD path incorrectly. Do the .bashrc edit. Restart PC. Do terminal commands. Since you most likely used the default install via package installer, the path should be your Android home dir. So, copy and paste the path from File>Settings>Appear..>SDK and paste into the .bashrc file path.

Under the source line...

export ANDROID_HOME=/home/your_login/Android/Sdk

then save the file. >Restart your PC. Do not simply logout.

Do the terminal commands suggested in the link below. Problem solved.

http://stackoverflow.com/questions/3954 ... gpu-driver

Solus runs AS very well and faster than all other distros. That is the only issue.

DEV.... Please correct paths in the installer package. :D

Event Timeline

donb9261 renamed this task from Android Studio {SOLVED] to Android Studio Emulator Error??? {SOLVED].Nov 8 2016, 1:52 PM
donb9261 created this task.
DataDrake renamed this task from Android Studio Emulator Error??? {SOLVED] to Android Studio Emulator Error.Nov 8 2016, 5:35 PM
DataDrake updated the task description. (Show Details)
DataDrake moved this task from Backlog to Package Fixes on the Software board.
DataDrake triaged this task as Normal priority.Nov 8 2016, 5:39 PM

@donb9261 your stackoverflow link is broken so don't really know what command your are trying :) but probably you need to add ANDROID_HOME/tools and ANDROID_HOME/platform-tools to your PATH

export ANDROID_HOME=/home/your_login/Android/Sdk

This is the key issue. And yes one could add this to their path, but AS is not clear to which path var to use. Easier and I found more reliable to simply follow the instructions listed.

Corrected link. My apologies....

http://stackoverflow.com/questions/39548584/android-studio-avd-linux-amdgpu-driver

So you have an AMD card and the AVD issue? If currently the only solution is to set a symlink to the system libstdc++ library this cannot be solved by the package itself. Because the package can't edit files in your $HOME and $HOME/Android is only generated at the first start of Android Studio. I'm not sure what this has to do with ANDROID_HOME. You only need to set a symlink like this ln -s /usr/lib64/libstdc++.so $HOME/Android/tools/lib64/libstdc++

I guess you have to use this solution until Android Studio uses a more recent version of libstdc++ https://code.google.com/p/android/issues/detail?id=197254#c15

The issue is that AS lloks for the std libraries in a different folder for the Emulator. The path variables for that are not settable within AS. You have to do the following to make it work. Solus uses the lib64 folder.

In your home directory .bashrc (hidden file) set environment variable:

export ANDROID_HOME=/path/to/your/android/sdk

Restart / logout.

cd $ANDROID_HOME/tools/lib64/libstdc++
mv libstdc++.so.6 libstdc++.so.6.bak
ln -s /usr/lib64/libstdc++.so.6 $ANDROID_HOME/tools/lib64/libstdc++

This correctly assigns the path vars...

No. I have an Intel i5 Quad. Gen 6

It only worked for me as shown. Not adding the path var to the .bashrc fails.

It fails because ANDROID_HOME is not set. You can also run export ANDROID_HOME=/path/to/your/android/sdk manually to set the environment variable.

AVD works fine for me. Could you please post the error message you get without the symlink? And do you know where Android Studio looks for the library?

File>Project Structure>SDK Locations

AS does not have a dialog to set the std libs path. This is in the install script. I presume (Seriously presume) that due to the fact that the error shows it failed to find the std libs in /lib/... AS fails before it could choose /lib64/... as the std libs folder.

The stackoverflow link shows the exact error created at the top. I no longer get the error so I cannot duplicate the issue.

So essentially all this operation does is push the files to the correct directory.

I am no whiz at Linux commands by any stretch.

Maybe adding the script to the package install script will ensure no matter what the structure is pointed correctly at all times. Like I said AS has no dialog nor help on the fix unless you are using a debian or fedora distro. Probably because are not aware of the power of Solus. :-)

BTW....

I used the graphical installer for installing AS. Not eopkg

Or AS has broken lib64 folder. Since the ln points AS to the system versions, I would assume they are.

Could you please post your error message? Because i'm not able to reproduce this.

Also /usr/lib instead of /usr/lib64 should be no problem, because /usr/lib is just a symlink to /usr/lib64

Contents of the error:

Cannot launch AVD in emulator.
Output:
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext

Major opcode of failed request:  153 (GLX)
Minor opcode of failed request:  6 (X_GLXIsDirect)
Serial number of failed request:  49
Current serial number in output stream:  48

libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext

Major opcode of failed request:  153 (GLX)
Minor opcode of failed request:  6 (X_GLXIsDirect)
Serial number of failed request:  49
Current serial number in output stream:  48

libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request: BadValue (integer parameter out of range for operation)

Major opcode of failed request:  153 (GLX)
Minor opcode of failed request:  24 (X_GLXCreateNewContext)
Value in failed request:  0x0
Serial number of failed request:  33
Current serial number in output stream:  34

QObject::~QObject: Timers cannot be stopped from another thread

The symlink is not the issue. AS looks in the sdk folder. If you look there is an Android/SDK/tools/lib64 folder. This is what is now bypassed by do the fix.

It is known AS bug..... Most likely fixed in V2.3 Lol.

https://code.google.com/p/android/issues/detail?id=197254#c15

Realize now it happens on other distros as well. I cannot even use AS with Ubuntu 16.04. Nor Mint 18. The AVD crashes. But, since I only use Solus for dev AS I have not tried the same fix for the other distros.

Check the bug tracker in the link above for more clues. I am out of them.... Wish I could help more. If I gain additional insights I will most certainly share.

Solus is AWESOME!

Yeah i've read the entry in the google bug tracker. I'm pretty sure this is a problem is the outdated libstdc++ in Android Studio and can be fixed with a symlink to the system libstdc++. I don't thing we can do anything about it here and have to wait for an update of Android Studio and this task can be closed

DataDrake closed this task as Resolved.Feb 23 2017, 2:04 PM
DataDrake claimed this task.