Settings for Android Emulator when it fails
[android] Using Android SDK: /opt/android-sdk-linux
[android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_en-US_120_WVGA_Google_Inc._Google_APIs_23_google_apis-armeabi-v7a.avd
[android] /opt/android-sdk-linux/tools/android create avd -f -a -s WVGA800 -n hudson_en-US_120_WVGA_Google_Inc._Google_APIs_23_google_apis-armeabi-v7a -t "Google Inc.:Google APIs:23" --abi google_apis/armeabi-v7a
[android] Could not create Android emulator: Failed to parse AVD config file
But as soon as I am entering Android OS Version to: 6.0 . It will succeed to create new emulator and it runs.
My requirement is that is need Google Maps support for emulator.
Install required libraries for 64-bit machines:
If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
source : https://developer.android.com/studio/install.html
I'm having the same issue, and it was a matter of permissions. I installed all the android sdk dependencies from a ssh console with user "console_user", and then Jenkins was triying to run the tools with user "jenkins". The solution comes in various steps:
Add user "jenkins" to group "console_user".
Add group write permissions to the android sdk home dir and all the subdirectories:
chmod g+w $ANDROID_HOME -R.
Hope this helps or at least give you an advice.
I have installed android SDK and android eclipse plugin successfully on Ubuntu 12.10.
I created the AVD in eclipse, and now it's not running. This is the output error I receive when I run the AVD:it tips:
Starting emulator for AVD 'avd'
Failed to start emulator: Cannot run program "/home/sancai/android/adt-bundle-linux-x86_64-20130522/sdk//tools/emulator": java.io.IOException: error=2, No such file or directory
I find information via google, everyone says this is because my system version is 64, while the adt only support 32, to install: sudo apt-get install ia32-libs, when I installed the 32-bit library, other problems arise such as the library file association to other libraries, but has no other library files are fully,it tips:
sancai#ubuntu:~$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ia32-libs : Depends: ia32-libs-multiarch but it is not installable
E: Unable to correct problems, you have held broken packages.
sancai#ubuntu:~$ sudo apt-get install ia32-libs-multiarch
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ia32-libs-multiarch is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'ia32-libs-multiarch' has no installation candidate
This should help:
Go to xx/sdk/tools and run:
mv emulator emulator.bak
ln -s emulator64-arm emulator
No need to install any ia32 libs.
This is the answer http://astroelec.blogspot.com/
(using Debian)
Installing ia32-libs will no longer work as debian has moved to multiarch support.
Solution. Use Multiarch
Multiarch support makes installing libraries from the i386 distribution easy...
sudo dpkg --add-architecture i386
sudo aptitude update
sudo aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
Now launch eclipse, and everything should now work just fine.
In my configuration, I have set up the virtual devices to use Intel Atom system image. Lawrence Angrave from the University Illinois said in his Coursera androidapps101 course that it will run faster than the ARM image. So this works for me:
mv emulator emulator_bak
ln -s emulator64-x86 emulator
You do not need install packages any more!
In directory tools, there are many types of emulator, while my computer works with emulator64-arm! My system is Linux Mint 16 amd64! Good luck!
./emulator64-arm #yxphone -sdcard yxsd -scale 0.8
it's easy,this is my solutions.
copy and paste, this lines in your terminal.
apt-get install libncurses5:i386 \
libstdc++6:i386 \
zlib1g:i386
good luck!!
This might help
sudo aptitude install ia32-libs lib32ncurses5 lib32stdc++6
I am trying to make my Android AVD run with Eclipse on Ubuntu 12.10. I created the AVD in eclipse, and now it's not running. This is the output error I receive when I run the AVD:
Starting emulator for AVD 'My_android-16'
- Failed to start emulator: Cannot run program "/usrdata/Dev/android-sdk-linux//tools/emulator": error=2, No such
file or directory
I'm using Ubuntu 12.10, latest Eclipse installed.
What I've done:
I gave /tools/emulator chomod 777 permissions.
cp /usrdata/Dev/android-sdk-linux/tools/emulator /usrdata/Dev/android-sdk-linux
You don't have to install all the ia32 package. You can just use:
sudo apt-get install lib32ncurses5 lib32stdc++6
Also, I needed to make a soft link for LibGL.so.1 as mentioned here.
ln -s /usr/lib/libGL.so.1 ~/android-sdk-linux_x86/tools/lib/libGL.so
Run the following command on terminal:
apt-get install ia32-libs
Ref:http://developer.android.com/sdk/installing/index.html#troubleshooting
I have installed Eclipse 4.2 with Eclipse android plugin(ADT)on ubuntu 11.10. when i launch "Hello World" project as an android application, it simply wont launch!
ps -x > log.txt after launching the emulator, output:
1000 7221 20.0 0.6 16884 6908 ? D 18:11 0:00 /home/tutakhail/android-sdks/tools/emulator-arm -avd AndroidBrowser -netspeed full -netdelay none
launching the emulator manually from shell, i get the following error, shortly after which the emulator launches but is very slow.
emulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so: cannot open shared object file: No such file or directory
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
Any hints on what could be the issue here? Perhaps related to Ubuntu?
Turns out the solution is to point LD_LIBRARY_PATH to the /tools/lib path.
Below works for me.
➜ tools file ../tools/lib/libOpenglRender.so
../tools/lib/libOpenglRender.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
➜ tools export LD_LIBRARY_PATH=/home/xxxx/devel/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH
➜ tools ./emulator-x86 -avd AtomX86 -gpu on -qemu -m 1024 -enable-kvm
emulator: emulator window was out of view and was recentered
....
I guess its a bug affecting the latest versions of the ADTs perhaps has something to do with NVIDIA GPUs drivers. The issue is discussed here:
https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc
The work around that I have found which at least lets me execute my applications till a permanent solution is released, is that by first launching the emulator from shell even if it throws the error. After which i right-click and run my projects as an "Android application". The emulator does surprisingly execute them!
I've got similar error, and I guess this error caused by missing libGL.so.
Install package libgl1-mesa-dev;
sudo apt-get install libgl1-mesa-dev
Source
Try running emulator from command line first to see if everything goes well.
You may need to add options like:
-no-audio
-gpu off
I've seen audio preventing emulator to start on some Ubuntu configurations.
I tried to use the Intel Hardware Acceleration in Ubuntu 12.04 for running emulators using KVM package. However I was getting the error, "Failed to start RenderThread". Installing the package libgl1-mesa-dev and reducing the Device RAM Size to 512 solved my problem. The emulator now is indeed atleast 10X faster. I hope this would help someone trying to emulate android devices in Ubuntu using Intel processor that supports Virtualizattion Technology.
SO i guess maybe you haven't installed everything properly.
You should check if you followed the steps as shown in :
http://www.wikihow.com/Install-Android-on-Ubuntu-Linux-With-Eclipse-Ide
After installing it properly and setting up the PATH environment variables .
Also another thing you can do is try deleting the AVD emulator and creating a new one and then try again .
Also i found your question over here at : https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc
THe question you asked is not really specific so just try following the steps.
The following command saved my life with the same problem
sudo apt-get install libgl1-mesa-dev
If using eclipse, you have to add in Project-Properties in the "Java Build Path" -> Libraries -> Android 4.4 -> "Native library location" the path to sdk/tools/lib directory.
For me this is "install-dir-of-sdk"/sdk/tools/lib"
Configure ANDROID_HOME
export ANDROID_HOME=//android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
and set LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$ANDROID_HOME/emulator/lib64:$LD_LIBRARY_PATH"
To run ARM version
cd $ANDROID_HOME/emulator/
./emulator64-arm -avd Nexus_5X_ARM_22 -no-audio -gpu off
I solved this on my Red Hat Linux 64 bit by installing the 32bit libGL (it should be located in /usr/lib/)
sudo yum install mesa-libGL.i686
libOpenglRender.so and other necessary files are present, indeed, in tools/lib64, while avd tries to find them in tools/lib
Making symbolic links to the files and dirs helped (in my case)
ln -s ../lib64/qt qt
ln -s ../lib64/gles_mesa gles_mesa
ln -s ../lib64/libstdc++ libstdc++
ln -s ../lib64/lib64GLES_V2_translator.so lib64GLES_V2_translator.so
ln -s ../lib64/lib64emugl_test_shared_library.so lib64emugl_test_shared_library.so
ln -s ../lib64/lib64OpenglRender.so lib64OpenglRender.so
ln -s ../lib64/lib64GLES_CM_translator.so lib64GLES_CM_translator.so
ln -s ../lib64/lib64EGL_translator.so lib64EGL_translator.so
(seems to be bug in original config, as that happens with fresh install of the studio/sdk)
I am using Ubuntu 12.04 (Precise Pangolin) with the Oracle JDK 7, and when I am running the Android emulator from Eclipse, it's giving this error:
[2012-07-04 02:52:10 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2012-07-04 02:52:10 - Emulator] Failed to load libGL.so
Also the emulator is very slow. How can I solve this problem?
I have the Android SDK installed into ~/android-sdk-linux_x86, so I did:
ln -s /usr/lib/libGL.so.1 ~/android-sdk-linux_x86/tools/lib/libGL.so
This solves errors just like linking to /usr/lib does, but it doesn't require root and doesn't mess with core system directories.
On 64-bit Ubuntu 12.04, do it like this:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Source: Installing required packages (Ubuntu 12.04)
I am using Ubuntu 12.04 64-bit. Using the following command to solve the problem
sudo ln -s /usr/lib32/fglrx/libGL.so.1.2 /usr/lib/libGL.so
Note: This is applicable only to those who use the AMD/ATI graphic drivers.
For 32-bit Ubuntu 12.04 LTS, this worked:
sudo apt-get install libgl1-mesa-dev
None of the following worked:
cd /usr/lib/i386-linux-gnu/mesa/
sudo ln -s libGL.so.1.2 libGL.so
sudo ln -s libGL.so.1.2 /usr/lib/libGL.so
ln -s libGL.so.1.2 ~/android/android-sdk-linux/tools/lib/libGL.so
What works for me (ubuntu 12.04 64bit) was just to run :
sudo apt-get install libgl1-mesa-dev
I found that libGL.so exists in directory /usr/lib/x86_64-linux-gnu/
Installation of 32 bit version was not working.
On 64 bit Ubuntu 12.04, there is no /usr/lib64. It is /usr/lib only.
Also, on my machine, libGL.so isn't present. Instead the file is libGLEW.so
To install /usr/lib/LibGL.so you can run:
sudo apt-get install libgl1-mesa-dev
However, it didn't solve the problem for me. In fact, it probably screwed up my system.
This worked for me on 64 bit Ubuntu 12.10 and the ADT bundle:
ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 ~/adt-bundle-linux-x86_64/sdk/tools/lib/libGL.so
If you don't have /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 just install libgl1-mesa-glx
sudo apt-get install libgl1-mesa-glx
I think I got it right, no warnings and no slowness... This might not work with proprietary drivers, though.
Make sure libgl1-mesa-glx:i386 is installed (even if you got a x64 SO file). Then do:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2 /usr/lib/libGL.so
NVidia Optimus:
Running on dual graphics (intel and nvidia), I used the following:
Install Bumblebee (see: https://wiki.ubuntu.com/Bumblebee#Installation)
Install the required lib.
Run the emulator on the nvidia discrete card.
This should do the trick:
sudo add-apt-repository ppa:bumblebee/stable
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install bumblebee bumblebee-nvidia linux-headers-generic
sudo apt-get install ia32-libs
Whenever you wish to run the emulator, just use optirun:
optirun emulator #<avd_name>
I should give a warning that I only installed Linux yesterday. So I don't really know what I'm doing….
Referring to http://developer.android.com/sdk/installing/index.html, I installed ia32-libs and did:
ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2 /usr/lib/i386-linux-gnu/mesa/libGL.so
That's all I did to solve this problem.
I use Linux Mint 14 - 64 bit and for me, it worked :) :
sudo apt-get install libgl1-mesa-glx libgl1-mesa-dev
On Ubuntu 12.04 64-bit, GNOME 3.4, I first referred to http://developer.android.com/sdk/installing/index.html and installed ia32-lib, which will generate /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
Then I run the below command and solved this problem:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/libGL.so
This is slightly different from gridstation's answer.
I guess there's no need to install the Mesa driver locally, which may cause issues with your real video drivers.
On Ubuntu 64 bit,
1. Check libGL,
$ locate libGL.so
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
2. Create a symlink where the SDK is installed
ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/local/android-studio/sdk/tools/lib/libGL.so
To make it work on a Ubuntu 12.10 (Quantal Quetzal) 64-bit, you have to do two things:
1) You have to initialize LD_LIBRARY_PATH
Example:
export LD_LIBRARY_PATH=~/tests/android/adt-bundle-linux-x86_64/sdk/tools/lib
Comments: change the path to your location
2) You have to create a symbolic link
a) Use locate libGL to find the correct library:
rudy#vsolutions:~$ locate libGL
/home/rudy/opt/android/android-sdk-linux/tools/lib/libGLES_CM_translator.so
/home/rudy/opt/android/android-sdk-linux/tools/lib/libGLES_V2_translator.so
/usr/lib/i386-linux-gnu/libGLU.so.1
/usr/lib/i386-linux-gnu/libGLU.so.1.3.1
...
/usr/lib32/nvidia-current/libGL.so.304.43
b) Create the soft link
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/libGL.so
Comments: use a 64-bit library on a 64-bit operating system!
Now start the emulator
My system is Optimus, and I have installed Bumblebee. I can use "Intel Open Source Technology Center" "Mesa DRI Intel(R) Ironlake Mobile " "2.1 Mesa 9.0" or "NVIDIA Corporation" "GeForce GT 330M/PCIe/SSE2" "3.3.0 NVIDIA 304.43".
a) Intel
/home/rudy/tests/android/adt-bundle-linux-x86_64/sdk//tools/emulator64-arm -avd avd_42 -scale 0.46 -gpu on -verbose
b) Nvidia
optirun /home/rudy/tests/android/adt-bundle-linux-x86_64/sdk//tools/emulator64-arm -avd avd_42 -scale 0.46 -gpu on -verbose
Comments:
I didn't see any difference between the Intel and the Nvidia cards... It is certainly because the emulator is not GPU intensive.
On my system an Intel Core i5, it took almost 1 minute to start the emulator... Please be patient... I find the emulator rather fast after it is loaded (the 1 minute to wait). If you start the emulator from the Eclipse IDE, then the emulator does a software emulation (the GPU is off) and took 1 min 30 to start... It is much more slower than using the Intel or Nvidia cards!!!
verbose is the parameter to use to display more diagnostics
optirun is the command to make use of the Nvidia on Bumblebee. If you don't have Bumblebee don't use it!
avd is a virtual device
gpu on to make use of the graphical card
OSError: libGL.so: cannot open shared object file: No such file or directory
It may appear on Linux systems when you try to launch VNL for the first time.
To solve it, create (as administrator) a new link in /usr/lib :
sudo ln -s /usr/lib/libGL.so.1.2 /usr/lib/libGL.so
If you have a 64-bit Linux, use /usr/lib64 instead .
First check that you actually have libGL.so.1.2 in /usr/lib or /usr/lib64 ; it might be called libGL.so.1 or something else instead, or located in another directory, depending on the video drivers.
You can use locate libGL to find the correct file to link to.
I had the same issue. But in my case, I solved it another (I think, better) way.
In my situation (Lubuntu 13.10), it was enough to simply also install the library libgl1-mesa-dev through Synaptic Package manager (the libgl1-mesa-dri library was already installed by default when the Lubuntuu distro was set up).
That solves all the hassle of putting links from one file to the other and also prevents polluting your system:
How will you know after several months (or years) what dedicated links you've put to keep the system running?
What about a future updates, if you start to do those things yourself? Will something be broken/not updated due to "manual intervention"?
If you use the "system mechanism", it's all done for you. And correctly done. That's why those tools are there in the first place.
Best rgds,
Similar to user1289608, I was able to do a sym link from an existing install of Mesa:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2 /usr/lib/libGL.so
I am using Ubuntu 12.04 64-bit. Linking /usr/lib64/libGLC.so.0 to /usr/lib64/libGL.so seems to solve the problem.
EDIT: It stops the error messages, but the emulator is still slow for me.
This worked for me:
Restart the adb from the DDMS:
In Eclipse: Window > Open Perspective... > Other > DDMS. Select the emulator from the left side pane and select "Restart adb"
You can also restart the adb server from the terminal window.
android-sdk-linux/platform-tools/adb kill-server
android-sdk-linux/platform-tools/adb start-server
I found the folder for libGL by the command "locate"
It turned out to be in /usr/lib/i386-linux-gnu/
~$ locate libGL
/usr/lib/i386-linux-gnu/libGLEW.so.1.8
/usr/lib/i386-linux-gnu/libGLEW.so.1.8.0
/usr/lib/i386-linux-gnu/libGLEWmx.so.1.8
/usr/lib/i386-linux-gnu/libGLEWmx.so.1.8.0
/usr/lib/i386-linux-gnu/libGLU.so.1
/usr/lib/i386-linux-gnu/libGLU.so.1.3.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
For my Debian 7 'Wheezy' installation I used the following command:
ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 opt/android/tools/lib/libGL.so
sudo apt-get install libgl1-mesa-dev
cd ~/Development/adt-bundle-linux-x86_64-20140321/sdk/tools/lib
unlink libGL.so
ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 libGL.so
that's it!
I had this problem because I had checked "Use Host GPU" when creating my AVD. I tried it with that option unchecked and I was able to successfully start the emulator. This is acceptable for my testing purposes, but if using the host GPU is important you'll probably want to try some of the other solutions here.
I had the same problem. Reinstalling the Nvidia driver fixed the segmentation fault for me.
I solved this problem by reinstalling libgl1, both the 64- and 32-bit libraries:
$ sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-glx:i386
Background: Previously I switched from the free radeon driver back to fglrx. I guess this somehow screwed up my libgl1, because fglrx comes with its own version.
Besides, I think that the other solutions provided here are possibly dangerous, because it is wrong to symlink 32 bit shared libraries into the (64 bit) /lib/ directory.
Check if you have libgl1-mesa-* packages installed. If so, install the libgl1-mesa-dev package to get the unversioned shared objects.
You shouldn't have to do this -- it's the Android team's error. Give them a break, they're only Java developers.