Android Studio Emulator "The emulator process for AVD was killed" - flutter

The emulator process for AVD Pixel_4_API_300a was killed.
I turned on virtualization, installed the missing tools. I downloaded the JDK. I read many threads and ideas to solve it but it didn't work.
LOG:
Emulator: C:\Users\emir\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_4_API_300a
Emulator: INFO | Android emulator version 31.3.10.0 (build_id 8807927) (CL:N/A)
Emulator: emulator: INFO: path_getAvdSystemPath: AVD Pixel_4_API_300a has path C:\Users\emir\.android\avd\Pixel_4_API_300.avd
Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
Emulator: emulator: INFO: path_getAvdSystemPath: trying to check whether C:\Program Files\Android\Sdk is a valid sdk root
Emulator: emulator: WARN: path_getAvdSystemPath: C:\Program Files\Android\Sdk\system-images\android-30\google_apis_playstore\x86\ is not a valid directory.
Emulator: emulator: WARN: path_getAvdSystemPath: emulator has searched the above paths but found no valid sdk root directory.
Emulator: Process finished with exit code 1
Here is output of flutter doctor:
output

Related

Mac and "PANIC: Missing emulator engine program for 'arm' CPU."

I am attempting to run an AVD I have created for API 16 on a Galaxy Nexus:
emulator #Galaxy_Nexus_Jelly_Bean_API_16
which gives the error
PANIC: Missing emulator engine program for 'arm' CPU.
Attempting to start it by pressing the play button from the AVD Manager inside Android Studio bounces something briefly in the tool dock, but it quickly vanishes and nothing shows up and there are no obvious error messages.
I have looked through other posts with similar problems. Most cite Avast on Windows as causing the issue. I am running on a Mac. I do not have Avast installed.
The AVD has the following configuration:
Name: Galaxy_Nexus_Jelly_Bean_API_16
CPU/ABI: Google APIs ARM (armeabi-v7a)
Path: /Users/prisoner/.android/avd/Galaxy_Nexus_API_16.avd
Target: google_apis [Google APIs] (API level 16)
Skin: galaxy_nexus
SD Card: 100 MB
hw.dPad: no
hw.lcd.height: 1280
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: Galaxy Nexus
vm.heapSize: 80
skin.dynamic: yes
hw.device.manufacturer: Google
hw.lcd.width: 720
hw.gps: yes
hw.initialOrientation: Portrait
image.androidVersion.api: 16
hw.audioInput: yes
image.sysdir.1: add-ons/addon-google_apis-google-16/images/armeabi-v7a/
hw.cpu.model: cortex-a8
tag.id: google_apis
showDeviceFrame: yes
hw.camera.back: virtualscene
hw.mainKeys: no
AvdId: Galaxy_Nexus_Jelly_Bean_API_16
hw.camera.front: emulated
hw.lcd.density: 320
avd.ini.displayname: Galaxy Nexus Jelly Bean API 16
hw.arc: false
hw.gpu.mode: auto
hw.device.hash2: MD5:5c288d27461585ecc73a535555e7cf61
hw.ramSize: 1024
hw.trackBall: no
PlayStore.enabled: false
fastboot.forceColdBoot: no
hw.battery: yes
hw.cpu.ncore: 4
hw.sdCard: no
tag.display: Google APIs
runtime.network.latency: none
hw.keyboard: yes
hw.sensors.proximity: yes
disk.dataPartition.size: 800M
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes
Android Studio environment:
Android Studio 3.1.4
Build #AI-173.4907809, built on July 23, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6
I have installed everything for this version of the SDK available in the SDK Manager:
I have the latest version of the emulator installed. I've tried uninstalling and re-installing it.
The ANDROID_HOME environment variable appears to be correctly set (it matches the Android SDK location in the SDK Manager. The emulator program appears to be the one under this home environment as well:
Mulan:~ prisoner$ echo $ANDROID_HOME
/Users/prisoner/Library/Android/sdk
Mulan:~ prisoner$ which emulator
/Users/prisoner/Library/Android/sdk/tools/emulator
As far as I can tell, the emulator and the architecture-specific emulators are also under ANDROID_HOME:
I'm at a loss about where else to look, either for error messages or the emulator that is there, but can't be found by the system, or how else to address the problem.
Update 1: Specify path explicitly.
Trying to specify the paths explicitly doesn't work either:
Mulan:~ prisoner$ /Users/prisoner/Library/Android/sdk/tools/emulator #Galaxy_Nexus_Jelly_Bean_API_16
PANIC: Missing emulator engine program for 'arm' CPU.
Mulan:~ prisoner$ /Users/prisoner/Library/Android/sdk/emulator/emulator #Galaxy_Nexus_Jelly_Bean_API_16
emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-qemu" is in the same location as your system image.
emulator: ERROR: ANDROID_SDK_ROOT is undefined
Sure enough, ANDROID_SDK_ROOT isn't defined. Defining it to the same thing as ANDROID_HOME does the following:
Mulan:~ prisoner$ export ANDROID_SDK_ROOT="$ANDROID_HOME"
Mulan:~ prisoner$ /Users/prisoner/Library/Android/sdk/emulator/emulator #Galaxy_Nexus_Jelly_Bean_API_16
emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-qemu" is in the same location as your system image.
emulator: ERROR: ANDROID_SDK_ROOT is defined (/Users/prisoner/Library/Android/sdk) but cannot find kernel file in /Users/prisoner/Library/Android/sdk/system-images/ sub directories
Looking underneath the system-images directory, we see a directory for each API platform:
Mulan:~ prisoner$ ls ~/Library/Android/sdk/system-images/
android-16 android-19 android-23 android-26
android-17 android-21 android-24 android-27
android-18 android-22 android-25 android-28
Looking just under the android-16 directory, we have
./default
./default/armeabi-v7a
./default/armeabi-v7a/build.prop
./default/armeabi-v7a/kernel-qemu
./default/armeabi-v7a/NOTICE.txt
./default/armeabi-v7a/package.xml
./default/armeabi-v7a/ramdisk.img
./default/armeabi-v7a/source.properties
./default/armeabi-v7a/system.img
./default/armeabi-v7a/userdata.img
./default/mips
./default/mips/build.prop
./default/mips/kernel-qemu
./default/mips/NOTICE.txt
./default/mips/package.xml
./default/mips/ramdisk.img
./default/mips/source.properties
./default/mips/system.img
./default/mips/userdata.img
./default/x86
./default/x86/build.prop
./default/x86/kernel-qemu
./default/x86/kernel-ranchu
./default/x86/NOTICE.txt
./default/x86/package.xml
./default/x86/ramdisk.img
./default/x86/source.properties
./default/x86/system.img
./default/x86/userdata.img
./google_apis
./google_apis/x86
./google_apis/x86/advancedFeatures.ini
./google_apis/x86/build.prop
./google_apis/x86/kernel-qemu
./google_apis/x86/kernel-ranchu
./google_apis/x86/NOTICE.txt
./google_apis/x86/package.xml
./google_apis/x86/ramdisk.img
./google_apis/x86/source.properties
./google_apis/x86/system.img
./google_apis/x86/userdata.img
Just tried and verified on my Mac, to solve this problem, you need to specify the -kernel path manually. i.e.
$ ~/Library/Android/sdk/emulator/emulator #Galaxy_Nexus_Jelly_Bean_API_16 -kernel ~/Library/Android/sdk/system-images/android-16/default/armeabi-v7a/kernel-qemu
Some references for you:
Emulator error: This AVD's configuration is missing a kernel file
https://developer.android.com/studio/run/emulator-commandline
--- Edit ---
To avoid typing the -kernel argument every time, you can also copy the ~/Library/Android/sdk/system-images/android-16/default/armeabi-v7a/kernel-qemu file to ~/Library/Android/sdk/add-ons/addon-google_apis-google-16/images/armeabi-v7a.
Maybe it is the emulator tool path issue. Try to specify the full path of your emulator path.
Try the answer from here. Windows emulator.exe PANIC: Missing emulator engine program for 'x86' CPU
[Partial answer - to a related issue on the IDE]
I have faced this problem also. My Android Studio couldn't even start the emulator, coming up with an error like "Emulator: Process finished with exit code 1". The fix there was to install/update the relevant system images under SDK Manager -> SDK Platforms (tab) -> Click "Show Package Details" and then "Apply".
However, this doesn't seem to make the CLI command emulator -avd <avd name> run, instead I see the PANIC error, but apparently it's related to the migration of the emulator from the SDK path /tools to /emulator

Android emulator won't start something not found

Android emulator won't start something not found:
21:40 Emulator: [4748]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at C:\Android\android-sdk\emulator\lib64\qt\lib
21:40 Emulator: Could not launch 'C:\Android\android-sdk\emulator/qemu/windows-x86_64/qemu-system-aarch64.exe': No such file or directory
21:40 Emulator: Process finished with exit code 2
21:41 Emulator: [1456]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at C:\Android\android-sdk\emulator\lib64\qt\lib
21:41 Emulator: Could not launch 'C:\Android\android-sdk\emulator/qemu/windows-x86_64/qemu-system-aarch64.exe': No such file or directory
21:41 Emulator: Process finished with exit code 2
I have gone to this issue and enable Android Emulator option in the Android Studio will fix it.
Could it help!
I can't run the Android Emulator
From your question I noticed the following error log:
21:41 Emulator: [1456]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at C:\Android\android-sdk\emulator\lib64\qt\lib
21:41 Emulator: Could not launch 'C:\Android\android-sdk\emulator/qemu/windows-x86_64/qemu-system-aarch64.exe': No such file or directory
This tells us that there is an issue with your Android Virtual Devices SDK.
I suggest you completely uninstall and then reinstall the Android Virtual Devices SDK (AVD Manager).
You can use the following instructions to help you out:
To uninstall/install the AVD Manager, go to Tools > SDK Manager > Android SDK and select the SDK Tools Tab. Then scroll down until you find the Android AVD/Virtual Devices SDK.

ionic framework can't load local notifications

I am taking Coursera's course for Multiplatform Mobile Devices and it says to call:
ionic plugin add de.appplant.cordova.plugin.local-notification
But I am getting the following error:
Toms-MBP:confusioncordova toddcoulson$ ionic platform add android
Error: Platform android already added.
Toms-MBP:confusioncordova toddcoulson$ ionic plugin add
de.appplant.cordova.plugin.local-notification Installing
"de.appplant.cordova.plugin.local-notification" for android
Installing "cordova-plugin-device" for android
Using this version of Cordova with older version of cordova-android
is being deprecated. Consider upgrading to cordova-android#5.0.0 or
newer.
Failed to install 'cordova-plugin-device':CordovaError: The provided
path
"/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android"
is not an Android project.
at new android_parser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/android_parser.js:35:15)
at new PlatformApiPoly (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:62:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:70:23)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:610:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:407:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
Failed to install
'de.appplant.cordova.plugin.local-notification':CordovaError: The
provided path
"/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android"
is not an Android project.
at new android_parser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/android_parser.js:35:15)
at new PlatformApiPoly (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:62:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:70:23)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:610:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:407:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
Error: The provided path
"/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android"
is not an Android project.
EDIT: I do think this is an issue getting the emulator for android to work. I thought I had things setup, but I never got the emulator working for android. Here is the error when running emulator:
Total time: 2.031 secs
Built the following apk(s):
/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=/Users/toddcoulson/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
No emulator specified, defaulting to testOne
Waiting for emulator to start...
emulator: Requested console port 5584: Inferring adb port 5585.
Creating filesystem with parameters:
Size: 69206016
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16896
Block groups: 1
Reserved block group size: 7 Created filesystem with 11/4224 inodes and 1302/16896 blocks emulator: WARNING: Camera name 'webcam0'
is not found in the list of connected cameras. Use '-webcam-list'
emulator option to obtain the list of connected camera names.
Hax is enabled Hax ram_size 0x77300000 HAX is working and emulator
runs in fast virt mode.
emulator: Listening for console connections on port: 5584 emulator:
Serial number of this emulator (for ADB): emulator-5584
[123145554325504]:WARNING:./android/base/files/IniFile.cpp:158:Failed
to process .ini file
/Users/toddcoulson/.android/emu-update-last-check.ini for reading.
Unknown hax vcpu return 1
Another EDIT:
I was able to get the plug-in to load once I had the android project setup with ionic and got Android Studio to load in an emulator. The emulator is still giving an error I put in the comments, but it did allow me to get past these errors.

Can not launch Emulator in Android

I have tried to launch the emulator in Android but I am getting the dialogue box displaying.
I have tried reading all the answers related to this but I have still failed.
emulator: WARNING: Crash service did not start
init: Could not find wglGetExtensionsStringARB!
getGLES1ExtensionString: Could not find GLES 1.x config!
Failed to obtain GLES 1.x extensions string!
emulator: WARNING: VM heap size set below hardware specified minimum of 128MB
emulator: WARNING: Setting VM heap size to 256MB
emulator: WARNING: Classic qemu does not support SMP. The hw.cpu.ncore option from your config file is ignored.
emulator: device fd:856
HAXM is working and emulator runs in fast virt mode
emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.
Could not initialize emulated framebuffer
Screenshot

Google TV emulation starting up with a non Google TV image and emulator-arm

I have the latest Google TV Addon (rev 2) and the latest emulator. My linux box also supports KVM and when I pass the command kvm-ok, I do get the success messages
(INFO: Your CPU supports KVM extensions
INFO: /dev/kvm exists
KVM acceleration can be used)
I have created a new AVD via Eclipse using Android AVD and SDK Manager and by setting the Target Name as: Google Tv Addon
However, when I start up the AVD instance (command line or Eclipse), I see a normal Android smartphone instance loading up in the skin of the Google TV (see all the phone apps and nothing happens when I click on the TV specific buttons in the navigation bar). In the verbose logs I do NOT see KVM Auto enabled message and from the excerpts of logs (added below), it looks like the default kernel, system and userdata images are being loaded instead of the images from the /bin/android-sdk-linux_x86/add-ons/addon_google_tv_google_inc_12/images/x86. It also looks like emulator-arm is being executed instead of emulator-x86. Why is this happening? How could I solve this problem? I would greatly appreciate any help in this regard.
emulator: Android virtual device file at: <path>/.android/avd/name1.ini
emulator: virtual device content at <path>/.android/avd/name1.avd
emulator: virtual device config file: <path>/.android/avd/name1.avd/config.ini
emulator: using core hw config path: <path>/.android/avd/name1.avd/hardware-qemu.ini
emulator: Found AVD target API level: 12
emulator: found skin '720p' in directory: <path>/bin/android-sdk-linux_x86/add-ons/addon_google_tv_google_inc_12/skins
emulator: autoconfig: -skin 720p
emulator: autoconfig: -skindir <path>/bin/android-sdk-linux_x86/add-ons/addon_google_tv_google_inc_12/skins
emulator: keyset loaded from: <path>/.android/default.keyset
emulator: trying to load skin file '<path>/bin/android-sdk-linux_x86/add-ons/addon_google_tv_google_inc_12/skins/720p/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: autoconfig: -kernel <path>/bin/android-sdk-linux_x86/platforms/android-12/images//kernel-qemu
emulator: autoconfig: -ramdisk <path>/bin/android-sdk-linux_x86/platforms/android-12/images//ramdisk.img
emulator: Using initial system image: <path>/bin/android-sdk-linux_x86/platforms/android-12/images//system.img
emulator: autoconfig: -data <path>/.android/avd/name1.avd/userdata-qemu.img
emulator: autoconfig: -initdata <path>/.android/avd/name1.avd/userdata.img
emulator: autoconfig: -cache <path>/.android/avd/name1.avd/cache.img
emulator: Physical RAM size: 1024MB
Content of hardware configuration file:
hw.cpu.arch = arm
....................
Cheers,
S
For a workaround, please try editing the ~/.android/[AVD_name].avd/config.ini file, and change "arm" to "x86" for the hw.cpu.arch and abi.type lines.