Can't provide avd path on ubuntu - android

I'm trying to build avd from console and faced with issue to provide right avd
Cannot find AVD system path. Please define ANDROID_SDK_ROOT
or
PANIC: Unknown AVD name [/home/dmitry/.android/avd/Nexus_4_API_26.avd], use -list-avds to see valid list.
this is what list avd returns to me
Name: Nexus_4_API_26
Device: Nexus 4 (Google)
Path: /home/dmitry/.android/avd/Nexus_4_API_26.avd
Target: Google APIs (Google Inc.)
Based on: Android 8.0 (Oreo) Tag/ABI: google_apis/x86
Skin: nexus_4
Sdcard: 100M
Full command with PATHs
dmitry#dmitry-H270-HD3:~/aosp/oreo$ sudo ./prebuilts/android-emulator/linux-x86_64/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilts/qemu-kernel/arm64/kernel -qemu-scale 0.7 -memory 2048 -partition-size 4096-verbose -avd Nexus_4_API_26
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
dmitry#dmitry-H270-HD3:~/aosp/oreo$ echo $ANDROID_SDK_ROOT
/home/dmitry/Android/Sdk
dmitry#dmitry-H270-HD3:~/aosp/oreo$ echo $ANDROID_HOME
/home/dmitry/Android/Sdk
dmitry#dmitry-H270-HD3:~/aosp/oreo$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/dmitry/Android/Sdk/tools:/home/dmitry/Android/Sdk/platform-tools:/home/dmitry/Android/Sdk/emulator:ANDROID_AVD_HOME:/home/dmitry/.android/avd
Any thoughts what is the root cause of the issue?

This seems to be an issue relating to the recent update. A temporary solution is to launch emulator from within the /path/to/android-sdk/tools directory in the commandline.
See https://code.google.com/p/android/issues/detail?id=235461 to follow the issue.
source

Related

Android Studio / Windows / `PANIC: Missing emulator engine program for 'x86' CPU.`

Context:
I have an Android virtual device that was created with Android Studio, that I must launch from command line for customization need.
Description:
Launching this command:
C:\Users\jonathan\AppData\Local\Android\Sdk\tools>emulator.exe -avd Pixel_3_API_30 -writable-system
(the -writable-system is because I need override the /etc/host/ file)
I get this error:
PANIC: Missing emulator engine program for 'x86' CPU.
Environment:
Windows 10
Java 8
Android Studio: 4.0
Android SDK Manager: 26.1.1
More detail:
Running in verbose:
C:\Users\jonathan\AppData\Local\Android\Sdk\tools>emulator.exe -avd Pixel_3_API_30 -writable-system -verbose
emulator:Android emulator version 26.0.3.0 (build_id 3965150)
emulator:Found AVD name 'Pixel_3_API_30'
emulator:Found AVD target architecture: x86
emulator:argv[0]: 'emulator.exe'; program directory: 'C:\Users\jonathan\AppData\Local\Android\Sdk\tools'
emulator: Found directory: C:\Users\jonathan\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\
emulator:Probing for C:\Users\jonathan\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\/kernel-ranchu: file missing
emulator:Auto-config: -engine classic (based on configuration)
emulator: Found directory: C:\Users\jonathan\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\
emulator:try dir C:\Users\jonathan\AppData\Local\Android\Sdk\tools
emulator:Looking for emulator-x86 to emulate 'x86' CPU
emulator:Probing program: C:\Users\jonathan\AppData\Local\Android\Sdk\tools/emulator-x86.exe
PANIC: Missing emulator engine program for 'x86' CPU.
PANIC: Missing emulator engine program for 'x86' CPU.
I had the same issue on Windows and the mklink was not helpful. What worked is the fact that you possibly calling the emulator from the old depricated path:
C:\Users\jonathan\AppData\Local\Android\Sdk\tools
Instead, call from:
C:\Users\jlalou\AppData\Local\Android\Sdk\emulator>
Call there ti run the Emulator outside of Android Studio:
C:\Users\App\AppData\Local\Android\Sdk\emulator>emulator -avd Pixel_XL_API_30
Try to open it directly from the sdk\tools directory.
C:\Users\DownStairs>C:\Android\android-sdk\tools\emulator -avd Nexus_5_API_28 -port 5555
PANIC: Missing emulator engine program for 'x86' CPU.
C:\Users\DownStairs>C:\Android\android-sdk\emulator\emulator -avd Nexus_5_API_28 -port 5555
INFO | Android emulator version 31.1.4.0 (build_id 7920983) (CL:N/A)
INFO | configAndStartRenderer: setting vsync to 60 hz
INFO | added library vulkan-1.dll
Open a prompt in admin mode.
cd C:\Users\jlalou\AppData\Local\Android\Sdk\emulator>
mklink emulator-x86.exe emulator.exe
Then run emulator-x86 instead of emulator, ie return to former console and execute
cd C:\Users\jonathan\AppData\Local\Android\Sdk\tools
emulator-x86.exe -avd Pixel_3_API_30 -writable-system
Warning: the Android image was restored to default: all data and applications were wiped out.

"Making the Android emulator run faster" explanation of answer

in the post
Making the Android emulator run faster
there is the answer:
Linux:
Install KVM: open GOOGLE, write "kvm installation "
Create AVD with "Intel atom x86" CPU/ABI
Run from command line: emulator -avd
avd_name -qemu -m 512 -enable-kvm
Or run from Eclipse: Run/Run
Configurations/Tab "Target" - > check Intel x86 AVD and in
"Additional Emulator Command Line Options" window add: -qemu -m 512
-enable-kvm (click Run)
I am using Ubuntu 16.04 (and Oracle VM virtual box and Genymotion - but do not know if it matters there), I probably sucessfully installed KVM. Although, I do not understand the next part:
Create AVD with "Intel atom x86" CPU/ABI
What program or command this is?
AVD means Android Virtual Device. They most likely mean the that you use the normal emulator in Android Studio.
Here's a link that describes the process
Basically you have several AVD images to pick from, and you have to pick one that has an x86 CPU as opposed to an ARM CPU in the ABI column.

Creating an AVD and linking it to the AOSP

I am trying to use this tool GemDroid https://github.com/huz123/GemDroid_QEMU. I have downloaded the AOSP android-4.4.4_r2 and built it as well. According to the link above, an AVD has to be created using Android Studio, which I did but it give selective options to download a system image, say an Android 4.4.
My first question is how can I link the AVD to the AOSP I have
downloaded? I tried pointing the location of the SDK to the AOSP
location from Files>ProjectStructure in Android Studio but it says
"SDK does not contain any platforms".
Is there a different way whereI can create an AVD directly from the
directory of AOSP?
Or according to the step "start the emulator with
your android virtual device as usual" in the link above, how can I
start the emulator from AOSP with an AVD created using Android
Studio?
I am using Ubuntu 14.04. Please help, thanks!
You don't need the Android Studio for that - just go to your root directory and type in the command line:
emulator
If this doesn't work you probably had a problem in your build.(Build the AOSP)
This is how I run the build
source ./build/envsetup.sh
lunch aosp_shamu-userdebug
./prebuilts/android-emulator/linux-x86_64/emulator
-sysdir out/target/product/shamu/
-system out/target/product/shamu/system.img
-ramdisk out/target/product/shamu/ramdisk.img
-data out/target/product/shamu/userdata.img
-kernel prebuilts/qemu-kernel/arm64/kernel-qemu
-scale 0.7
-memory 2048
-partition-size 4096
-no-window
-verbose

Android SDK. Can't start AVD

Problem:
I'm using only command line tools. AVD just worked fine some time ago. Now with various configurations I get only "Starting emulator for AVD..." which simply closes without any error messages and leaving emulator.exe in Task Manager for eternity.
What I've tried:
Various devices, API's, RAM above and below 768, with/without Host
GPU etc;
Reinstall Java;
Reinstall Android SDK;
Run emulator from command line just launches emulator.exe without any errors;
Delete .android folder in User's folder;
Set ANDROID_SDK_HOME variable;
Run SDK Manager.exe/AVD Manager.exe with/without elevated Admin rights;
verbose key gives me the following log:
emulator:Found AVD name 'jkll'
emulator:Found AVD target architecture: arm
emulator:Auto-config: -engine classic (arm default)
emulator:Looking for emulator-arm to emulate 'arm' CPU
emulator:Probing program: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:return result: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:Found target-specific 32-bit emulator binary: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:Adding library search path: 'C:\Soft\Android\android-sdk\tools/lib'
emulator: Found directory: C:\Soft\Android\android-sdk/add-ons\addon-google_apis-google-17\images\armeabi-v7a\
emulator: Found directory: C:\Soft\Android\android-sdk/add-ons\addon-google_apis-google-17\images\armeabi-v7a\
Configuration I am working on:
Windows 10 x64
Android SDK Manager 25.1.1
Java JDK 8 Update 91
i5 CPU with 24GB of RAM
Any suggestions? TY.
I tried all the mentioned solutions. But strangely, I reduced my windows 10 laptop's resolution (from 3840 x 2160 to 1360 x 768) and it worked.
With your verbose I found you are using arm architecture devices.As you are using i5 processor,Windows10 x64 I would Suggest you to use x86 or x86-64 architecture for your devices for this you have to Install Intel x86 Emulator Accelerator (HAXM) from SDkManager.
Hope this helps let me know.
After changed the CPU of my computer and updated sdk, I encounter this problem too.
Now I temporarily solve the problem emulator-x86 I get an error about missing Qt5Core.dll, Qt5Widgets.dll and Qt5Gui.dl:
copy *.dll files in sdk\tools\lib\qt\lib to sdk\tools where the emulator-x86.exe in.

Running android emulator using nexus 5 factory image

I've been trying to run the android emulator using nexus 5 factory image.
I've download the factory image and extracted from it the following files:
system.img
boot.img
recovery.img
userdata.img
cache.img
After that, I've extracted from boot.img the ramdisk.img and zImage files.
I tried to run the emulator with the following command:
#!/bin/bash
/home/xx/a/android/sources/out/host/linux-x86/bin/emulator -sysdir /home/xx/a/yy/ -system /home/xx/a/yy/system.img -ramdisk /home/xx/a/yy/boot/initrd.img -data /home/xx/a/yy/userdata.img -kernel /home/xx/a/yy/boot/zImage -sdcard /home/xx/a/android/out/sources/sdcard -memory 512 -partition-size 1024
The emulator will start running without the error, but it will neither show the boot screen nor load the launcher.
It doesn't show any error and i can't get a logcat, meaning, i guess that android hasn't been loaded and it failed earlier.
Now, my question is - What might the reason for it not to work?

Categories

Resources