I am developing with Android Studio 1.5 on an emulated Nexus 5 (API v23) with Ubuntu 15.10 x64. I am behind a proxy (http_proxy environment variable is set).
Creating a new project, and I get an error straight off the bat. This answer fixes it. Next I try to build it, the emulated phone frame loads, but is black (no content shown). The console says this:
Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5_API_23_x86
emulator: WARNING: UpdateCheck: failed to get a URL: 51 (Error)
emulator: WARNING: UpdateCheck: failed to get the latest version, skipping check (current version '24.4.1'
So maybe it's a proxy issue? - BTW: my "gradle.properties" automatically populated: systemProp.http.proxyHost, systemProp.http.proxyUser, systemProp.http.proxyPort.
EDIT: Same error with Android/Sdk/tools$ ./emulator #Nexus_5_API_23_x86 -http-proxy $HTTP_PROXY
When used your This answer i got the error in command line as
FATAL:.//android/base/sockets/SocketWaiter.cpp:88:Check failed: isValidFd(fd). fd 1064 max1024
So this error can be resolved by starting emulator from the command line using this command
emulator.exe -avd <avd_name> -no-audio -http-proxy <proxy_name>:<proxy_port>
Related
I try to develop an android system, I have some problems with development.
I get used to ubuntu18 and tag of android 11 is android-11.0.0_r17,
I have built successfully with lunch 30 "aosp_x86-eng" and I have seen $OUT files and checked
then I prepared test_aosp.sh file under ~/bin
the results are like that and no emulator window appears:
$ ./test_aosp.sh
emulator: Android emulator version 30.0.21.0 (build_id 6647651) (CL:N/A)
emulator: Found AVD name 'a25x86'
emulator: Found AVD target architecture: x86
emulator: argv[0]: 'emulator'; program directory: '/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64'
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
the content of test_aosp.sh is :
#!/bin/sh
emulator -avd a25x86 -verbose -show-kernel -system $OUT/system.img -ramdisk $OUT/ramdisk.img -initdata $OUT/userdata.img
when I checked ROGER YE notes, before that partition he had run ~/Android/Sdk/emulato/emulator #a25x86, also I did it with the last version of android studio.
Also, I try to do the following thing but is has a loop in the command line and the black window of emulator shows up but not appear any menu and any more:
$ sudo ~/Android/Sdk/emulator/emulator -avd a25x86 -verbose -show-kernel -system $OUT/system.img -ramdisk $OUT/ramdisk.img -initdata $OUT/userdata.img
also I have checked the emulator location with the following command:
$ which emulator
/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64/emulator
also I want to add following results, maybe you want to check it:
$ printenv |grep ANDROID
ANDROID_DEV_SCRIPTS=/home/ubuntu/aosp/development/scripts:/home/ubuntu/aosp/prebuilts/devtools/tools:/home/ubuntu/aosp/external/selinux/prebuilts/bin:/home/ubuntu/aosp/prebuilts/misc/linux-x86/dtc:/home/ubuntu/aosp/prebuilts/misc/linux-x86/libufdt
ANDROID_TOOLCHAIN_2ND_ARCH=
ANDROID_PRE_BUILD_PATHS=/home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/bin:
ANDROID_HOST_OUT_TESTCASES=/home/ubuntu/aosp/out/host/linux-x86/testcases
ANDROID_JAVA_TOOLCHAIN=/home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86/bin
ANDROID_TARGET_OUT_TESTCASES=/home/ubuntu/aosp/out/target/product/generic_x86/testcases
ANDROID_BUILD_TOP=/home/ubuntu/aosp
ANDROID_BUILD_PATHS=/home/ubuntu/aosp/out/soong/host/linux-x86/bin:/home/ubuntu/aosp/out/host/linux-x86/bin:/home/ubuntu/aosp/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin:/home/ubuntu/aosp/development/scripts:/home/ubuntu/aosp/prebuilts/devtools/tools:/home/ubuntu/aosp/external/selinux/prebuilts/bin:/home/ubuntu/aosp/prebuilts/misc/linux-x86/dtc:/home/ubuntu/aosp/prebuilts/misc/linux-x86/libufdt:/home/ubuntu/aosp/prebuilts/clang/host/linux-x86/llvm-binutils-stable:/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64:/home/ubuntu/aosp/prebuilts/asuite/acloud/linux-x86:/home/ubuntu/aosp/prebuilts/asuite/aidegen/linux-x86:/home/ubuntu/aosp/prebuilts/asuite/atest/linux-x86:
ANDROID_EMULATOR_PREBUILTS=/home/ubuntu/aosp/prebuilts/android-emulator/linux-x86_64
ANDROID_PRODUCT_OUT=/home/ubuntu/aosp/out/target/product/generic_x86
ANDROID_PYTHONPATH=/home/ubuntu/aosp/development/python-packages:
ANDROID_TOOLCHAIN=/home/ubuntu/aosp/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin
ANDROID_JAVA_HOME=/home/ubuntu/aosp/prebuilts/jdk/jdk11/linux-x86
ANDROID_HOST_OUT=/home/ubuntu/aosp/out/host/linux-x86
Could you guide me?
Thank you
Regards
if you successfully built, you can run emulator without additional arguments. Just typing emulator in console.
Or, please try to set ANDROID_SDK_ROOT as suggested.
export ANDROID_SDK_ROOT=/path/to/your/sdk/for/avd
Getting errors:
Emulator: emulator: ERROR: Unknown AVD name [Nexus_6P_API_28], use
-list-avds to see valid list.
Emulator: Process finished with exit code 1
Virtualisation is on and lib64stdc++6:i386 is installed
This problem is resolved.
The problem occur due to android studio is opening in sudo mode.
I'm using ubuntu 16.10. When I start my emulator from android studio I got this error:
"ADB reject shell command (cat/proc/3655/stat):closed"
And its not opening. But I can run emulator from command line by following command:
"LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libstdc++.so.6' ~/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5X_API_25"
And it shows the warning message:
"emulator: WARNING: encryption is off"
It may be occur due to your 64bit linux didn't match to the avd you installed. Try copy 'lib' folder from your Android sdk location -> ../Android/Sdk/tools/lib64/qt/lib to ../Android/Sdk/tools/lib/qt/lib
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.
I'm using a 64bits Debian and when I try to run this:
$ emulator64-x86 -verbose -avd cocos2dx-emulator -gpu on -qemu -m 2047 -enable-kvm
The process just hangs and the only way to stop it is using kill -9, these are the last output lines it prints:
[...]
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/vgabios-cirrus.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/vgabios-cirrus.bin
If I use emulator-x86, it works fine:
$ emulator-x86 -verbose -avd cocos2dx-emulator -gpu on -qemu -m 2047 -enable-kvm
[...]
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/bios.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/vgabios-cirrus.bin
emulator: trying to find: /home/victor/lab/androidr16/android-sdk-linux/tools/lib/pc-bios/vgabios-cirrus.bin
emulator: autoconfig: -scale 1
emulator: Could not open file: (null)/system/build.prop: No such file or directory
emulator: sent '0012host:emulator:5555' to ADB server
[...]
I don't have any clue about what's going on and I'm not able to find any possible related errors in the system logs.
Any ideas?
A similar bug has been filed in AOSP (see below), although most of us experience the same result with emulator-x86 as well.
As a workaround, try to uninstall KVM and see if the emulator runs. It will obviously be slower since it's not using the VT extensions of your CPU, but it may narrow the source of the problem.
Issue 33817: emulator-x86 + kvm triggers an endless loop in qemu-setup.c
https://code.google.com/p/android/issues/detail?id=33817
Then again, you might only need to run the 32-bit emulators and this might not be an issue at all.
Edit: The issue appears to be caused by a clone() in pulseaudio code called from external/qemu/audio/paaudio.c. A patch that adds the BEGIN_NOSIGALRM guard is available on the Issue 33817 thread, post 16:
https://code.google.com/p/android/issues/detail?id=33817#c16