I had the same problem and I tried many things.
I updated everything I could in Android Studio and SDK Manager. Gradle and Android Gradle Plugin got updated in the process – but this didn’t help.
Then I updated cordova (from 8.1.2 to 9.0.0) and cordova-android (to 8.0.0) to latest versions – but this in itself didn’t help either.
Only removing and re-adding android platform finally solved the issue:
npm install -g cordova@latest
npm install cordova-android@latest --save
ionic cordova platform remove android
ionic cordova platform check android
ionic cordova platform add android









![Cannot read property ‘toLowerCase’ of undefined [ERROR] An error occurred while running subprocess cordova.](https://blog.rahulbhutani.com/wp-content/uploads/2020/12/ionic-enable-xcode-permissions-banner-218x150.png)







