Cordova adb problem

If you upgrade to Android Studio 3.5.3 and macOS Catalina, then you upgrade npm and Cordova too, you can see this error, when you try to run an Android emulator from terminal

Failed to execute shell command "getprop,dev.bootcomplete"" on device: Error: adb: Command failed with exit code 1 Error output:
error: device unauthorized.

The Android emulator starts, but I cannot find my app there.

Because Android Studio 3.5.3 changed a directory structure I add this to the system PATH variable:

PATH=$PATH:~/Library/Android/SDK/platform-tools

Now I can use adb command in the terminal anywhere.

I tried all from this https://stackoverflow.com/questions/50935337/failed-to-execute-shell-command-getprop-dev-bootcomplete-on-device-error-for but it didn’t work. I must try running apk from Android Studio (chose apk on disk in Android Studio) and then Android Studio asks for permissions in the new macOS.

If you get something like this error log message after a run

SDK not found
Failed to find Android target '27'
Install missing platform and fix project

Click on the Install missing platform and fix the project link. Then I finally see my app in Android Emulator! But the error doesn’t disappear 😀

So, I try a new setup and new emulator, now not Nexus 5 on Android 7, but Pixel 2 on Android 10. Now I get this:

PANIC: Missing emulator engine program for 'x86' CPU.

And I go to sleep! 😀

Update – NEXT DAY

I used Google and find, that error can be from the update – Android Studio modified more own paths. Just for sure I remove Android Studio and install it like new. Then I try rewrite the PATH variable with this, where the username is my home directory name:

PATH=/Users/username/Library/Android/sdk/emulator:/Users/username/Library/Android/sdk/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/username/Library/Android/SDK/platform-tools

Command “cordova run –emulator” ends now with INSTALL SUCCESS, LAUNCH SUCCESS. Hallelujah!

Permanently PATH modification

This is a Mac. Catalina has a new shell ZSH. So, I must edit the variable PATH permanently. It is easy, if you know, how. Run the terminal and write:

cd

This command takes you to the home directory.

nano .zshrc

This will open file .zshrc in editor nano. Here I add my PATH content after $PATH variable:

export PATH="/usr/local/sbin:$PATH:/Users/username/Library/Android/sdk/emulator:/Users/username/Library/Android/sdk/tools:/Users/username/Library/Android/SDK/platform-tools"

Press CTRL+O (save) and CTRL+X (exit). Done. Now terminal/SHELL knows, where Android tools for Cordova are, even if you restart your machine.

Sublime Text 3 PHP check problem

Today, after I edited PHP script and I save it – I got this message:

dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /usr/local/bin/php
Reason: image not found

I tried to update brew, npm, gawk – many tips I found on the internet. But it did not work.

If I uninstalled PHP Syntax Check in Sublime Text Editor, a message is gone. Reinstalling did not help – the message is back. So, I went to this page, where this plugin lives:

https://github.com/naomichi-y/php_syntax_checker/blob/master/phpSyntaxChecker.py and here I found a command

php -l

I tried it in a terminal and I got the same error message, as before in Sublime Text 3.

Newer is not automatically better

The first problem was the version of openssl library. For some reason, homebrew updated the SSL library to 1.1, but this plugin needs 1.0.

The solution was not straight and simple, but after a little googling, I found this:

brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

but, I had dependencies that don’t allow simple removal of this library, so I had to upgrade this command to

brew uninstall --force --ignore-dependencies openssl; brew uninstall --force --ignore-dependencies openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

Then I tried command “php -l” again and the terminal answered me with a new error message

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib

Here helps a simple link to the new version

cd /usr/local/opt/readline/lib
ls

I checked, what version I have on my computer, and then I linked the old version to my new version

ln -s libreadline.8.0.dylib libreadline.7.dylib

Now – Sublime Text 3, if I’m editing my PHP script and I make some syntax mistake – I get my old good friendly warning.

Hello people

Here you can find something about web/internet technologies. Solving some problems, that I had.