Got the same error, but the issue for me was a missing system-images.
Fixed with:
sdkmanager "system-images;android-34;google_apis;x86_64"
I was trying to run Android 34. You can list all available options with sdkmanager command.
sdkmanager