I tried to get an Android AVD working for Jelly Bean (API-16) and Google APIs (I included both in the platform definition). When running the AVD I would get the following error.
$ emulator -avd Nexus_7_API_16_With_Google_APIs
emulator: ERROR: This
AVD's configuration is missing a kernel file!! emulator: ERROR:
ANDROID_SDK_ROOT is defined (C:\data\applications\Android\Sdk) but
cannot find kernel file in
C:\data\applications\Android\Sdk\system-images\ sub directories
I've read through all the similar instances I could find on Stackoverflow and other sites, but none seemed pertinent to my situation.
Unlike most configuration files, the ones used for Jelly Bean and Google API appear to be located in
add-ons rather than in system-image. E.g.:
$ cd $ANDROID_SDK_HOME/.android/avd/Nexus_7_API_16_With_Google_APIs.avd/config.ini
$ grep image config.ini
image.sysdir.1=add-ons\addon-google_apis-google-16\images\armeabi-v7a
In fact, "system-image" appears to be hardcoded into the emulator (although it is possible there is a path around that -- see Cannot run emulator in Android Studio).
This looks very much like a bug to me.
Advice???
Thanks,
Barry
Related
After adding my device ( Pixel 2 Pie 9.0 API-28) This error log is shown. I manage and configure sdk manger. After that I install Hyper V for emulating third party emulator for visual studio. Everything was ok but when I lunch my device this error is showing. What is the problem and can you show me any solution to solve this?
I tried to reset device manger or delete devices. But that doesn't work.
This is my Error log.
Device error: emulator: Android virtual device file at: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.ini
emulator: virtual device content at C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd
emulator: virtual device config file: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\config.ini
emulator: using core hw config path: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\hardware-qemu.ini
emulator: using snapshot lock path: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\snapshot.lock
emulator: using multi-instance lock path: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\multiinstance.lock
emulator: Found AVD target API level: 28
emulator: Read property file at C:\Program Files (x86)\Android\android-sdk\system-images\android-28\google_apis_playstore\x86\\build.prop
...
...
...
emulator: Concatenated backend parameters:
'"C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe"' -verbose -feature WindowsHypervisorPlatform -avd pixel_2_pie_9_0_api_28 -prop emu.uuid=5b4f3ed6-3bd5-45c9-a093-06751e03b091
I really want to know how to resolve it.
Thank you.
It is best to uninstall and reinstall API 28 and any corresponding files and SDKs. Either that or beside the apply changes button in the SDK there should be a button for repair. Click that and allow it to run.
I simply replaced the existing Mono.Posix.dll with the latest version of Mono.Posix.dll, to do so copy the .dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Xamarin.VisualStudio and it started working for me, you can get the latest Mono.Posix.dll from https://www.dllme.com/dll/files/mono_posix_dll.html
The Android Device Manager asked me if i want to reinstall i said yes, clicked accept and that was all (It make take a couple of minutes so be patient)
I'm trying to use emulator.exe as android emulator for Charles Proxy. But I have problem, when I launch
emulator #5.1_WVGA_API_28
I get this error:
PANIC: Missing emulator engine program for 'x86' CPU.
But I can run the emulator from android studio and it's working fine! I have an intel processor.
If you want to run emulator from command line,
<your-full-path>/emulator -avd 5.1_WVGA_API_28
For newer version of Android SDK, the emulator path should be something as below:
/<xxx>/Android/sdk/emulator/emulator
For older version of Android SDK, the emulator path is as below:
/<xxx>/Android/sdk/tools/emulator
Try either one of above to see which is your case.
Here is the official document for Android emulator command line usage: https://developer.android.com/studio/run/emulator-commandline
That was not a path/location problem on my PC.
I have to use x86_64 system images to get the emulator working from the command line...
https://stackoverflow.com/a/56099493/531322
I have solved the problem. You must install HAX drivers. You can do it here: https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm Or just do update of SDK:
C:\Users\%username%\AppData\Local\Android\Sdk\tools\android.bat update sdk
#shizen answer worked for me using "...emulator/emulator" but even after changing the path in .zprofile (I use zsh on Mac), it was finding the old emulator. To find out which emulator your system is using, use "which emulator". In my case it was still loading the old one so I deleted the old path (rm -R /usr/local/bin/emulator) and now the correct (new) emulator loads.
After I built Android from AOSP source the official guide suggests that launching emulator is all one needs to do. Sadly that does not work for me...
(I am building for Nexus 7 "deb", Android Studio is not involved, not even present on this very machine.)
emulator: ERROR: bad workspace: cannot find prebuilt ranchu kernel in: ~/aosp/prebuilts/qemu-kernel/arm/ranchu/kernel-qemu
emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-ranchu" is in the same location as your system image.
emulator: ERROR: ANDROID_SDK_ROOT is defined (~/aosp/sdk) but cannot find kernel file in ~/aosp/sdk/system-images/ sub directories
Is my ANDROID_SDK_ROOT set properly? One would guess it should be ~/aosp/sdk, but apparently the emulator expects system-images right under ${ANDROID_SDK_ROOT}/. My system-images resides in ~/aosp/prebuilts/devtools though.
When I change it to ~/aosp/prebuilts/devtools it still isn't good enough:
...
emulator: ERROR: ANDROID_SDK_ROOT is defined (~/aosp/prebuilts/devtools) but cannot find kernel file in ~/aosp/prebuilts/devtools/system-images/ sub directories
But there are actually several kernel-ranchu files in those subdirectories:
~/aosp/prebuilts/devtools/system-images/android-23/android-tv/x86/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-23/default/x86/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-23/default/x86_64/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-23/google_apis/armeabi-v7a/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-23/google_apis/x86/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-23/google_apis/x86_64/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-25/android-tv/x86/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-25/android-wear/armeabi-v7a/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-25/android-wear/x86/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-25/google_apis/x86/kernel-ranchu
~/aosp/prebuilts/devtools/system-images/android-25/google_apis/x86_64/kernel-ranchu
Which one is the correct one and how do I deliver it to the emulator?
I tried several -kernel <kernel> but either I got a fatal memory error (for the x86_64-based ones) or I get an emulator with black screen and a popup saying that emulator based based on x86 would be much faster (with the google_apis/armeabi-v7a.) I waited tens of minutes for the last one, nothing happens, still the black screen, not even "android" logo. Maybe because in the middle of the output there is following message:
ERROR: resizing partition e2fsck failed with exit code 8
...strangely the process is not terminated, not sure how fatal the error is then.
Select your CPU/ABI to Google APIs Intel Atom (x86_64) when create the simulator AVD
The issue was that only small subset of targets is intended to run in the emulator. Those with specific device in their name ("deb") are not blessed.
After days of struggling with aosp_deb-userdebug and -eng I tried full-eng and that one works as charm.
I am able to compile AOSP + binaries and flash my Nexus 5 device. I then realized that it would probably be more practical to make my changes and run these builds on the emulator first to sanity check what I'm doing (I use my Nexus 5 as my main phone).
I've tried running the emulator by typing "emulator" after the build. I get the following error:
ko:Invalid cache partition image type: yaffs2 (expected ext4)
I created a Nexus 5 AVD in Android studio and confirmed that ANDROID_PRODUCT_OUT is pointing to /out/target/product/hammerhead, then I tried the following from the /out/target/product/hammerhead directory:
emulator -avd Nexus_5_API_21 -kernel ~/android-5.0.1_r1/prebuilts/qemu-kernel/x86/kernel-qemu -system ./system.img -ramdisk ./ramdisk.img -data ./userdata-qemu.img
The emulator appears to start up, but I see nothing.
Another piece of information that might help is that when I run the command "android list" I see the following:
Available Android targets:
Available Android Virtual Devices:
The following Android Virtual Devices could not be loaded:
Name: Nexus_5_API_21
Path: ~/.android/avd/Nexus_5_API_21.avd
Error: Unknown target 'android-21' in /home/julio/.android/avd/Nexus_5_API_21.ini
It doesn't seem to like the target android-21, and there doesn't seem to be any targets defined at all.
Anyway, does anyone know how to get this working? I want to avoid having to constantly flash my phone.
Thanks
Building for emulator and real devices are different things. In order to build AOSP for an emulator, you do not need to download any additional binaries. You should only select appropriate targets in lunch command. You can choose among the following targets:
aosp_arm
aosp_x86
aosp_x86_64
etc.
These targets build images to run on different processors architectures (arm, x86, x86-64, etc.).
You can also select different variants (user, userdebug, eng). The details of these variants of builds are explained here.
I downloaded a third-party ROM, and I want to run it on the emulator first before flash it into the phone. Here is the contents of cm-11-20140911-NIGHTLY-p3110.zip:
1. boot.img
2. file_contexts
3. META-INF/
4. recovery/
5. system/
I unpacked boot.img using the script unpack-bootimg.pl and get boot.img-kernel, and boot.img-ramdisk.cpio.gz. Then I repacked the system using the make_ext4fs and got system.img.
I created an AVD and execute:
emulator -system ~/cm11/system_new.img -ramdisk ~/cm11/boot.img-ramdisk.cpio.gz -kernel ~/cm11/boot.img-kernel -avd and442
but all I got is nothing, the emulator screen is just black. There is no log message from adb -s emulator-5554.
Now I am confused:
can the third-party ROM be tested by the emulator?
Am I doing the right way?
Yeah, why not.
We can flash a third-party ROM on Android AVD. But first you must know the following things:
1. The Android Emulator is itself a device, like your Moto G or Xperia
2. Every ROM is device-specific (supports a device-specific Kernel)
(on many sites/blogs you got information like you have to replace system.img file from .android\avd\avdname.avd, but it is technically incorrect, because you also require ramdisk.img.)
To do this, you need to create your own AOSP repository by downloading the particular repository and have to build your own .img files)
You can do it in two ways:
replace files system.img and ramdisk.img from location .android\avd\avdname.avd
Build your own AOSP. Before... make in "lunch" select target as: Emulator (like: genericX86), i.e., generate all emulator specific .img files
I have tried many things. It's a bit critical, but interesting. The following links may help you:
To run your cooked ROM on Emulator (link down. Try this, from archive.org).
To Create AOSP Project