[V1] [Solved] Cordova Set-up Ubuntu / Linux
-
Hello all!
So I’ve recently started playing around with cordova, and I’m sharing a few technical issues I encountered along the way
1. Missing emulator engine
PANIC: Missing emulator engine program for 'x86' CPU.
Explanation
The latest version of android studio stores emulator bins under
~/Android/Sdk/emulator
Hence on my system the wrong binaries were running when cordova loads
Solution
First check where the emulator binary lives via:
$ which emulator
If you get
home/<user_name>/Android/tools/emulator
then update the .bashrc PATHvim ~/.bashrc
or user an editor of you’re choiceexport PATH=" ........ :$ANDROID_HOME/emulator
note This needs to come before any reference to
$ANDROID_HOME/tools
2. /dev/kvm permission denied
note virtualization technology needs to be enabled. This is done within your BIOS settings
Solution
$ sudo apt install qemu-kvm
$ sudo adduser <USERNAME> kvm
$ sudo chown <USERNAME> /dev/kvm
- Restart your computer
3. CLEARTEXT_NOT_PERMITTED
The emulator is running but the cordova app fails to load resulting in the following error:
application error CLEARTEXT_NOT_PERMITTED
Explanation
Recent version of android (API 28 and above) don’t allow connections to http servers as they are considered insecure. However during development are server is http
see android-docs for more
Solution
Make an avd that uses an android image with API version less than 28
ex. running android 8.0I encountered a couple more issues but these are the main ones.
Please note I’m new to cordova so these may not be the best solutions but they worked in my case. -
I am having the same issue in mac
-
@mKomo you helped me, thanks!