When I start the emulator in Android Studio :
(Used Ubuntu 18.04.3 LTS)
Emulator: Warning: QStandardPaths: wrong ownership on runtime
directory /run/user/1000/snap.android-studio, 0 instead of 1000
((null):0, (null))
Emulator: Warning: QXcbIntegration: Cannot create platform OpenGL
context, neither GLX nor EGL are enabled ((null):0, (null))
There are two problems:
a) likely that snap install is crap, better install the standalone version of Android Studio
or run sudo chown -R 1000:1000 /run/user/1000/snap.android-studio to fix the permissions.
b) you need to install GL drivers, assuming you have a suitable graphics card available.
One can check these GL drivers with glxinfo -B.
Related
Via remote viewer VNC I can boot android emulator on remote machine
emulator -avd emu1
but via SSH on remote machine I get error
emulator: INFO: QtLogger.cpp:68: Warning: could not connect to display ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Info: Could not load the Qt platform plugin "xcb" in "/opt/androidtest/android-sdk/emulator/lib64/qt/plugins" even though it was found. ((null):0, (null))
Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
((null):0, (null))
but If I boot emulator headlessly via SSH, the emulator boots
emulator -avd emu1 -no-window
To be exact, it does not matter from where you started the session but the value the DISPLAY environment variable contains, which indicates the XWindows display the emulator will be using to show the window and to receive mouse and keyboard events.
Then, you can start your session from SSH or VNC and set the DISPLAY environment variable to point to an X server you have access to.
The client program (in this case the emulator) knows which display to connect to by inspecting the DISPLAY environment variable.
Additionally, as it was mentioned in some comments, ssh -X or ssh -Y can be used to enable X11 forwarding. In this case, you can verify how the DISPLAY environment variable is automatically set to forward the display.
When you're connecting via SSH you are in a command-line session, detached from the UI. As aa result there is no link to the display, which is the error shown here:
emulator: INFO: QtLogger.cpp:68: Warning: could not connect to display ((null):0, (null))
When you're in VNC, the emulator can connect to the local display easily.
You can try X-window display remoting -
export DISPLAY=0:0
and assuming you have the display remoting allowed (xhost +) on the Window session) then the emulator window will pop up there. iptables/netfilter might block this, btw, so try with/without, and then add a specific rule (TCP 6000 if memory serves)
Note that, while this works, 'xhost +' is considered bad practice (as it allows GUI session hijacking). Also, if you're SSHing then you won't really be able to see the GUI (unless you're on another Linux, in which case DISPLAY=IP_youre_SSH_ing_from:0 and xhost + on the host you're ssh'ing from will actually get you a remote display).
i am trying to laundch kvm for previewing my work in android studio. When trying to "start" 'kvm_intel' by using the command:
modprobe kvm_intel
The error i recieve is:
modprobe: ERROR: ../libkmod/libkmod-module.c:192
kmod_module_parse_depline() ctx=0x555a638cb010
path=/lib/modules/4.9.0-kali3-amd64/kernel/arch/x86/kvm/kvm.ko
error=No such file or directory
modprobe: ERROR: ../libkmod/libkmod-module.c:192
kmod_module_parse_depline() ctx=0x555a638cb010
path=/lib/modules/4.9.0-kali3-amd64/kernel/arch/x86/kvm/kvm.ko
error=No such file or directory
modprobe: ERROR: could not insert 'kvm_intel': Unknown symbol in
module, or unknown parameter (see dmesg)
First check if your CPU supports virtualization
sudo apt-get install cpu-checker
Output:
INFO: /dev/kvm exists
KVM acceleration can be used
or
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used
When I run:
/usr/local/android-sdk-linux/tools/emulator -avd tst
I get the error:
Failed to open lib64EGL_translator
Failed to init_egl_dispatch
emulator: ERROR: OpenGLES initialization failed!
emulator: ERROR: OpenGLES emulation library could not be initialized!
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
emulator: emulator window was out of view and was recentered
I've followed the steps here: http://www.redips.net/android/emulator-fedora-linux/
I've also tried using the commands emulator-arm and emulator64-arm
Another thing I tried was
export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH
Another attempt was with the parameters:
-no-audio -gpu off
I'm using a fresh install of CentOS 6.6 with yum update ran. I'm using the android SDK: http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
I ran /usr/local/android-sdk-linux/tools/android and installed the Android 5.0 api+arm. I tried again with a Android 4.4 AVM.
I've tried all the suggestions I could find. Any other suggestions?
Before running the emulator from the command line add the lib64 directory to the LD_LIBRARY_PATH, e.g.:
$ export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib64:$LD_LIBRARY_PATH
or
$ export LD_LIBRARY_PATH=$HOME/Android/Sdk/tools/lib64:$LD_LIBRARY_PATH
dependently on the SDK installation path.
My reply is meant to "second" brian's post, so it is known brian is not the only one seeing this error.
On my CentOS 6.6 box I have also tried the same steps listed and I am also seeing nearly the same error messages. The only difference is I do not get:
emulator: emulator window was out of view and was recentered
My emulator does run with just basic invocation (this AVD is not configured to use the host's GPU):
emulator -avd Nexus_S_ARM
But the error messages indicate something is broken and should be put right.
The 'export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH' made it workd for me. Also specfied '-gpu off' in the command line.
So, the issue i correctly installed eclipse,android sdk,ndk, coocs2d-x 2.1.4. I can build cocos2d-x android project, import it to eclipse, etc. Everything seems fine, but not really. The problem is that i can't launch my virtual machine to emulate andoid OS. I created avd, it works fine with simple android projects, but when i use it to run cocos2d-x project as android application it does nothing. No output at all. I found this guide and followed it. But i faced a problem. 1st of all, when i follow this step:
Now start the Android for x86 Intel Emulator using the following command:
$ <SDK directory>/tools/emulator-x86 -avd Your_AVD_Name -qemu -m 2047 -enable-kvm
i have an error message:
gloomist-CN tools # ./emulator-x86 #myavd -qemu -m 2047 -enable-kvm
emulator: ERROR: unknown virtual device name: 'myavd'
emulator: could not find virtual device named 'myavd'
But it is in sdk as a valid android virtual device. And the next one. In that tutorial that i pasted link to above, the last step is:
Run the emulator with the correct library path and options
Make sure to
Set the library path to the directory containing the Open GL library for the emulator (LD_LIBRARY_PATH=...)
Run the x86 version of the emulator (run /tools/emulator-x86)
Enable GPU use (Use the option "-gpu on")
Also, you need to specify the name of the Android Virtual Device to use (Use the option "-avd ")
On OS X the command line looks like this
LD_LIBRARY_PATH=~/bin/android-sdk/tools/lib ~/bin/android-sdk/tools/emulator-x86 -verbose -avd android17x86 -gpu on
i don't really know what author meant by all this. Could anyone explain me the way to do it in linux?
So basically, the main problem is: how to run a cocos2d-x project on AVD in eclipse on lixnux? That's it.
I use Linux version 3.2.0-23-generic (buildd#palmer) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:41:14 UTC 2012 (Ubuntu 3.2.0-23.36-generic 3.2.14).
Can anyone help me to figure out how can i accurately launch my cocos2d-x project on AVD using eclipse?
Are you sure 'myavd' is a valid avd?
Try to run this command to get a list of AVD's you have created in your system:
# <SDK directory>/tools/android list avd
And re-run emulator-x86 passing a valid avd.
I also suggest you follow the step by step guide about how to configure your android enviroment which comes with cocos2d-x dist. You can find it in: /samples/Cpp/TestCpp/proj.android/README.md
Hope this helps
I was able to fix this error on Ubuntu 18.04 by running:
sudo chmod 777 /dev/kvm
Its not exactly high security, but it gets the job done.
I am working on an Ubuntu 12.04 machine. I have built android from source code (gingerbread release 2.3.6), and trying the emulator. But it fails to open audio output.
Results of audio debug are below:
myself#mycomp:~/my-android$ out/host/linux-x86/bin/emulator -debug audio
emulator: WARNING: system partition size adjusted to match image file (70 MB > 66 MB)
emulator: qpa_audio_init: entering
emulator: could not find libpulse on this system
emulator: qpa_audio_init: exiting
audio: Could not init `pa' audio driver
emulator: qesd_audio_init: entering
emulator: could not find libesd on this system
audio: Could not init `esd' audio driver
audio: Could not init `alsa' audio driver
emulator: qpa_audio_init: entering
emulator: could not find libpulse on this system
emulator: qpa_audio_init: exiting
audio: Could not init `pa' audio driver
emulator: qesd_audio_init: entering
emulator: could not find libesd on this system
audio: Could not init `esd' audio driver
audio: Could not init `alsa' audio driver
oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
audio: Failed to create voice `goldfish_audio'
emulator: warning: opening audio output failed
I see that pulseaudio is running:
myself#mycomp:~/my-android$ ps aux | grep pulse
myself 2015 0.0 0.0 415940 5972 ? S<l 09:26 0:00 /usr/bin/pulseaudio --start --log-target=syslog
myself 7402 0.0 0.0 9380 932 pts/5 S+ 11:44 0:00 grep --color=auto pulse
also I have some libpulse libraries under /usr/lib/ :
myself#mycomp:/usr/lib$ find . -name "libpulse*"
./x86_64-linux-gnu/libpulse-simple.so.0.0.3
./x86_64-linux-gnu/libpulse-mainloop-glib.so.0.0.4
./x86_64-linux-gnu/libpulsecommon-1.1.so
./x86_64-linux-gnu/libpulse.so.0.13.5
./x86_64-linux-gnu/libpulse.so.0
./x86_64-linux-gnu/libpulse-mainloop-glib.so.0
./x86_64-linux-gnu/libpulse-simple.so.0
./x86_64-linux-gnu/libpulsedsp.so
./jvm/java-6-openjdk-amd64/jre/lib/amd64/libpulse-java.so
./libpulsecore-1.1.so
I have searched the net for solutions to the problem, but I could not find anyone working for me.
Thanks in advance,
The x86 (32bit) version of the libraries are available when you install the package 'libpulse0:i386':
sudo apt-get install libpulse0:i386
This will privide the libraries: /usr/lib/i386-linux-gnu/libpulse-simple.so
The emulator should now be able to run with the audio output detected.
Alternatively, you can launch the emulator with the option '-no-audio' to disable the audio subsystem completely.
I guess that you cannot build gingerbread on Ubuntu 12.04. Here you can find the following note:
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
I've tried to build it but there were several problems in my case so I preferred to switch to Ubuntu 10.04
If you are building the emulator yourself, you probably need to have the libpulse-dev package installed on your build system. It looks like you probably don't have that installed, as your library list doesn't include some versionless symlinks included in the -dev package.
You could either try
sudo apt-get install libpulse-dev
and reconfigure and rebuild and try again, or maybe first as a test install a prebuilt sdk and see if audio works in its emulator on your system.
I have the same issue on Fedora 17 64 bit, the issue was the corresponding 32 bit lib is missing, and android only need the 32 bit version lib. it was fixed by :
#sudo yum install libpulse.so.0
as you are in Ubuntu, you might need to run
#sudo apt-get install libulse.so.0