Ionic 5.4 does not identify android sdk

Good evening. I am developing an app with ionic cli 5.4, cordova, gradle 6.7 with android sdk 9.0. I would like to build the application using android sdk 5.0.0, but even when I delete the version of sdk 9, leaving only what I want in the android studio folder, assigning the gradle and sdk path as global windows variables or giving commands set ANDROID_HOME and GRADLE_HOME, when I give the command ionic cordova platform add android@5.0.0 he cannot find the sdk