For that just remove your platform through this command
ionic Cordova platform rm android
Then add the API version from the android studio:https://prnt.sc/tdwxgx
Just add these versions from the android studio and then add the android platform through this command.
ionic Cordova platform add android
And Then build the app it's working on the android 10 as-well.