When compiling Cordova Ionic android on android studio and it gives an error or path in Cordova_lib or Gradle, just delete the android folder from the platform and do ionic Cordova platform add android. Open the android folder in Android studio again and build. Important, do not change anything in android studio, anything from the android folder or everything will break.
Take a look at the other article here