An unknown server-side error occurred while processing the command. Original error: Could not find 'adb' in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path

I am using .zshrc file for setting the environment since my .bash is not supporting in my mac.
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/

#Setting path for android home
export ANDROID_HOME=/usr/local/Caskroom/android-sdk

#Adding path of platform-tools folder in PATH evn var
export PATH="/usr/local/Caskroom/android-sdk/4333796/platform-tools:${Path}"

export M2_HOME=/Users/ZOP3722/apache-maven-3.6.3
export PATH=$PATH:/Users/ZOP3722/apache-maven-3.6.3/bin

export PATH=$HOME/bin:/usr/local/bin:$PATH

You can change the default shell on your Mac to bash. But if you want to stick with the zsh shell, then you will very likely need to modify the .zshenv file instead of .zshrc; the former is sourced on all invocations of the shell while the latter is sourced only in interactive shells.

I suspect you are using an IDE. If this is the case, you also need to restart it after modifying the right file.