ERR_SDK_NOT_FOUND: No valid Android SDK root found.

While running npx cap run android if you are facing the following error:

native-run failed with error
        
ERR_SDK_NOT_FOUND: No valid Android SDK root found.
        
More details for this error may be available online:
        https://github.com/ionic-team/native-run/wiki/Android-Errors

The solution is to install Android Studio https://developer.android.com/studio.

Installing the Android Studio will automatically install the Android SDK needed for the project.