Skip to content

chore(flutter): 放宽 device_info_plus 版本范围以提升兼容性 - #110

Open
bruce3x wants to merge 1 commit into
qiniu:masterfrom
bruce3x:master
Open

chore(flutter): 放宽 device_info_plus 版本范围以提升兼容性#110
bruce3x wants to merge 1 commit into
qiniu:masterfrom
bruce3x:master

Conversation

@bruce3x

@bruce3x bruce3x commented Aug 14, 2026

Copy link
Copy Markdown

将 device_info_plus 从 ^11.3.0 调整为 >=9.0.0 <14.0.0

将 device_info_plus 从 ^11.3.0 调整为 >=9.0.0 <14.0.0,
兼容 Flutter 3.16 起步的更多环境(9.x 起仅需 Flutter >=3.3,8.x 及以下为 Dart 2 世代约束,Dart 3 无法解析)

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本次变更的下限能够让 Flutter 3.16 解析到仍兼容现有 DeviceInfoPlugin.deviceInfo 用法的 9.x/10.x;但上限跨入了带有额外原生构建要求的 12.x,导致部分仍在包声明支持范围内的 Android 工程会解析成功后构建失败。建议在合并前收紧上限,或同步提升并验证 Android 工具链要求。

Comment thread flutter/pubspec.yaml

dependencies:
device_info_plus: ^11.3.0
device_info_plus: ">=9.0.0 <14.0.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 将 device_info_plus 上限限制在 12.0.0 以下

该范围会让使用 Dart >=3.7 / Flutter >=3.29 的消费者解析到 device_info_plus 12.x,但 12.0.0 起原生插件明确要求 AGP >=8.12.1、Gradle >=8.13 和 Kotlin 2.2.0;这些要求没有编码进 pub 的 SDK 约束。仓库自带 example 目前仍是 AGP 8.7.0、Gradle 8.10.2、Kotlin 1.8.22,因此在这类受 qiniu_flutter_sdk 声明支持的 Flutter 环境中,pub get 会选中 12.4.0,随后 Android 构建因工具链过旧而失败。为了达到兼容 Flutter 3.16 的目标,应先将上限收紧为 <12.0.0,除非同时提升最低工具链并验证对应工程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant