While adding android platform to your Ionic project if you are getting the following error:
ERR_UNSUPPORTED_API_LEVEL: Unsupported API level: [error] native-run failed with error
The solution is to to install the missing SDK or a lower one from Android Studio.
Go to Android Studio > Preferences > Appearance & Behavior > System Settings > Android SDK
Install the lower APIs like 30/31 and uncheck teh one which is complaining, 32 in this case.
![](https://studyraft.com/wp-content/uploads/2022/04/image-184-1024x756.png)
Click Show Package Details check at the bottom to show the sub items of those SDKs.
Check the “Google Play … Intel and ARM” images checkboxes for API Levels to which you are downgrading. API Level 31 in this case.
![](https://studyraft.com/wp-content/uploads/2022/04/image-185-1024x835.png)
Wait till the installation of SDKs are done
![](https://studyraft.com/wp-content/uploads/2022/04/image-179-1024x920.png)
Running npx cap add android command after that will fix the issue.
npm install @capacitor/android npx cap add android