The solution for me was opening Android Studio and going to SDK Manager, switch to the SDK Tools tab and check Android SDK Command-line Tools (latest).
- Open SDK Manager from your Android Studio.
- SDK Tools tab
- Check Android SDK Command Line Tools as in the picture
- Then again run