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
Related
I listed the emulators using:
emulator -list-avds
Attempt to launch an emulator:
emulator -avd Pixel_XL_API_25
And terminal replies:
PANIC: Unknown AVD name [Pixel_XL_API_25], use -list-avds to see valid list.
ANDROID_AVD_HOME is defined but could not find Pixel_XL_API_25.ini file in $ANDROID_AVD_HOME
(Note: avd is searched in the order of $ANDROID_AVD_HOME,$ANDROID_SDK_HOME/.android/avd and $HOME/.android/avd)
The path actually seems off:
echo $ANDROID_AVD_HOME
Produces:
/Users/alex/.android
Which should be: /Users/alex/.android/avd
Fixed that, new exception:
[140737069994944]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '../emulator/qemu/darwin-x86_64/qemu-system-i386': No such file or directory
Does anyone know how to resolve this?
A solution that worked helped was to update my bash profile:
export ANDROID_HOME=${HOME}/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/emulator
Could not launch emulator in Android Studio
Note:
I still can't use the GUI integrated into Android Studio. I have to run the emulator command:
sudo emulator -avd Nexus_Emulator
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
I have been trying to get the source code to compile from some time and finally got it compiled. However I am having issues with the emulator where it shows a pop up screen but is quite blank.
I am using Ubuntu Server Xenial and Android 7.1.1 for Nexus6P (but I dont own a Nexus6P so I need to run this on the emulator)
I have tried specifying all the directories such as (-sysdir,-sysdir, -datadir, -kernel, -ramdisk, -system, -data, -cache, -sdcard) although I know that these are supposed to be auto populated by the envsetup.sh file.
The command I used is this:
emulator -kernel ./prebuilts/qemu-kernel/arm64/kernel-qemu -ramdisk ./out/debug/target/product/angler/ramdisk.img -sysdir ./out/debug/target/product/angler/ -cache ./out/debug/target/product/angler/cache.img -system ./out/debug/target/product/angler/system.img -data ./out/debug/target/product/angler/userdata.img -memory 4096 -partition-size 4096 -sdcard sdcard.img -skindir ./sdk/emulator/skins/ -skin WVGA800
I changed the kernel to others such as for ARM/ARM64 but to no avail. All I see is a blank emulator and after changing it to ARM following error:
http://pastebin.com/A04NmNLn
I am at a loss as to why the emulator wont work. Also where is the "image" file with which we can install the Android on Genymotion-type external emulator.
Any help is appreciated!
In order to build AOSP to be run in emulator, there is no need to download any additional binaries. At the same time, emulator cannot run images build for real devices. Therefore, it is required to only download the sources of Android and execute the following commands within the directory with the downloaded sources:
source build/envsetup.sh
lunch aosp_arm-eng #or aosp_x86_64-eng, etc. for details see documentation
make -j4
After the sources are build in the same terminal run the emulator command and the emulator should appear.
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