I'm trying to run a phonegap app on android and when i run the command
phonegap run android --emulator --verbose
I am getting this error
Running command "getprop emu.uuid" on emulator-5554...
How do i fix this, any ideas? I tried opening it via both command line and android studio emulator hands in both.
If the emulator fails to launch due to the error vulkan-1. dll cannot be found , you probably need to update the emulator. To update the emulator in Android Studio, go to Tools > SDK Manager and install the latest stable version of Android platform.
Run your app on the emulatorIn the toolbar, select the AVD that you want to run your app on from the target device drop-down menu. Click Run. The emulator might take a minute or so to launch for the first time, but subsequent launches will use a snapshot and should launch faster.
I have found that if I manually start the AVD before issuing the run command then I do not get this error. Also I found that running an older version of android solves this issue. I do not know exactly how this happens. Running windows 10.
I was getting this error on a Android 6.0 API Level 23 Device with cordova on fedora 23 with qemu.
It would run the cordova emulate android
and the emulator would show but the app wouldn't install or open in the emulator.
My problem was caused by cordova trying to wait for the device to be ready by polling getprop emu.uuid
on the adb shell.
Running getprop emu.uuid
in the adb shell didn't yield any results. Looking at the output of getprop
shows that an available property is dev.bootcomplete
.
I fixed it by changing the following code in platforms/android/cordova/lib/emulator.js (around lines 215-230) to wait for dev.bootcomplete
to be 1 instead of polling emu.uuid
:
module.exports.wait_for_emulator = function(uuid) {
...
new_started.forEach(function (emulator) {
promises.push(
//Adb.shell(emulator, 'getprop emu.uuid') REMOVE THIS
Adb.shell(emulator, 'getprop dev.bootcomplete')
.then(function (output) {
//if (output.indexOf(uuid) >= 0) { REMOVE THIS
if (output == 1) {
emulator_id = emulator;
}
})
);
});
...
This may break when you're running multiple emulators at once.
It looks like the problem is with the emulator. cordova runs emulator -avd <device-name> -prop emu.uuid=cordova_emulator_<date>
but emu.uuid
isn't properly set in the emulator.
Hope this helps somebody.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With