Home > Mobile >  Capacitor 3 and Ionic 6 Android build hitting "uses-sdk:minSdkVersion 1 cannot be smaller than
Capacitor 3 and Ionic 6 Android build hitting "uses-sdk:minSdkVersion 1 cannot be smaller than

Time:12-30

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 enter image description here

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.

enter image description here

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!).

  1. Delete android folder from the Ionic Project's root folder.
  2. run command ionic capacitor add android
  3. run command ionic capacitor build android
  4. Build & run!
  • Related