androidandroid-appcompatandroid-min-sdk

Does AppCompat now require minSdKVersion >= 21?


My app has a minSdkVersion of 19 and uses AppCompat. This has worked fine through AppCompat version 1.6.1, but with 1.7.0, the app does not build (in Android Studio):

Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [androidx.appcompat:appcompat-resources:1.7.0] /home/<username>/.gradle/caches/transforms-4/xxxxxxxx/transformed/appcompat-resources-1.7.0/AndroidManifest.xml as the library might be using APIs not available in 19
        Suggestion: use a compatible library with a minSdk of at most 19,
                or increase this project's minSdk version to at least 21,
                or use tools:overrideLibrary="androidx.appcompat.resources" to force usage (may lead to runtime failures)

The AppCompat documentation (including the version 1.7 / 1.7.0 "Important changes since 1.6.0" section) says nothing about a (new) requirement of minSdkVersion >= 21. Is this an undocumented change, or a bug / something that will eventually get sorted out? Am I missing something, or do I really have to choose between raising my minSdkVersion or getting stuck on an outdated AppCompat version?

(I understand that many will recommend just raising the minSdkVersion, since such old devices aren't worth supporting anyway. I'd rather not do that if I don't have to, though, and I'd like to understand what's going on.)


Solution

  • I found where it says it was updated here

    Caution: AndroidX libraries are moving to a default minimum supported Android API level 21 (previously 19) starting with releases in April, 2024. If you are currently supporting a lower minSdkVersion, we recommend bumping up to 21 and cleaning up any code to support prior versions.

    So yes you need to choose if you want to stay on an old version or not