Finally found a solution, based on a response from SO:
I may have deleted platforms folder beforehand
- Run:
ionic cordova platform rm android
- Run:
ionic cordova platform add android@8.0.0
- Run:
ionic cordova plugin add cordova-plugin-androidx
- Run:
ionic cordova plugin add cordova-plugin-androidx-adapter
- Make sure your gradle.properties has:
cdvMinSdkVersion=19
- Make sure your build.gradle has:
project.ext { defaultBuildToolsVersion="28.0.3" //String defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4 defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default }
- Make sure your confix.xml has:
<preference name="android-minSdkVersion" value="19" />
This person explains the problem pretty well on his answer, so i encourage you to read it.