I'm quite stuck here despite having found a few quite similar Stack Overflow questions.
My specific case is trying to get an app to build on Android which I recently updated to Ionic 6 and most notably added Capacitor – while still using Cordova for a couple of plugins, but no longer for builds.
The work in progress is public on
In that window, on the left side, select the app
module.
Once selected, click on the Flavors
tab on the top of the window pane.
Set your minimum SDK version to 21.
Explanation: As Android updates to new versions, tools that developers use for Android change (& update or deprecate). Because of this, you cannot use new tools on an old version. Version 1
is the very first Android SDK (and we definitely don't want to be using that!). Capacitor requires the SDK be at least version 21
.
2nd Attempted Fix
If that doesn't work, we can always try rebuilding the android app all together. (Note: By doing this, you will lose any custom changes in the AndroidManifest.xml, a custom app icon, etc. If you haven't touched any of these things, then great!).
- Delete
android
folder from the Ionic Project's root folder. - run command
ionic capacitor add android
- run command
ionic capacitor build android
- Build & run!