Skip to content

[packages] Scrub Android plugins for pre-API 21 support #157106

@stuartmorgan-g

Description

@stuartmorgan-g

The current stable version of Flutter now requires API 21+, but most of our plugins have not been updated to reflect that, and still support API 19+. We have some tech debt related to older API support, and it would be good to find an clean out proactively (examples we've seen so far include flutter/packages#7876 and https://github.com/flutter/packages/pull/7874/files#r1802064758, but those are just things we've hit randomly so an audit would almost certainly turn up more)

This would look something like:

  • Ensure that all the Android plugin implementation packages require Flutter 3.24+ (already true for many)
  • Update them to minSdkVersion 21 (this should not be a breaking change as long as Flutter itself requires 21, but IIRC minSdkVersion can trigger behavior changes—although I don't remember if that's true at the level of our setting, or only at the level of the client app building them)
  • Update the app-facing package README support table to say 21+ (some are probably quite stale; we don't currently have any checks in CI that these match the implementation package, which is a tracked issue).
  • Scrub for any references to Build.VERSION that reference KITKAT or LOLLIPOP to see what's still needed in code.
  • Delete or migrate any robolectric tests that reference api 20 or below. Tests that are verifying removed api behavior should be deleted, tests that verify apis work should be migrated.
  • Ideally search any Java/Kotlin code for other references to KitKat, Lollipop, 19, 20, and 21 to try to catch things that aren't specifically Build references (like the second example above).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.c: tech-debtTechnical debt, code quality, testing, etc.packageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions