You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级至Android SDK 32后执行flutter pub get遇版本错误求助

Android SDK 32升级后Flutter pub get出现SDK版本错误求助

将个人Flutter项目升级至Android SDK 32后,执行flutter pub get命令时出现SDK版本错误,已查阅社区相关解决方案但仍无法解决问题。以下是项目的pubspec配置文件及错误截图:

SDK版本错误截图

description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.17.0 <3.0.0"

dependencies:
  dio: ^4.0.0
  rxdart: ^0.27.1
  bloc_pattern: ^3.0.0

  flutter_launcher_icons: ^0.10.0
  flutter_translate: ^4.0.3
  flutter_localizations:
    sdk: flutter
  equatable: any
  json_annotation: any
  freezed_annotation: any
  webview_flutter: ^3.0.4
  flutter_cache_manager: ^3.3.0
  upgrader: ^4.6.1
  video_thumbnail: ^0.5.3

  ## Animation rive
  #rive: ^0.7.22

  # Native
  package_info_plus: ^1.0.3
  geolocator: ^9.0.2
  path_provider: ^2.0.2
  file_picker: ^4.1.6
  open_file: ^3.2.1
  url_launcher: ^6.0.8
  shared_preferences: ^2.0.6
  qr_code_scanner: ^1.0.1
  cross_file: ^0.3.2
  camera: ^0.10.0+3

  # Layout
  introduction_screen: ^3.0.2
  font_awesome_flutter: ^10.1.0
  select_form_field: "^2.1.0"
  #mask_text_input_formatter: ^2.0.0
  another_flushbar: ^1.10.24
  flutter_switch: ^0.3.2
  flutter_app_badger: ^1.2.0
  image_picker: ^0.8.5+3
  flutter_neat_and_clean_calendar: ^0.3.8+22
  date_utils: ^0.2.0
  date_format: ^2.0.2
  #flutter_form_builder: ^6.0.1
  date_time_picker: ^2.1.0
  flutter_rating_bar: ^4.0.0
  signature: ^5.2.1
  flutter_simple_treeview: ^3.0.0-nullsafety.1
  widget_to_image: ^2.0.0
  flutter_email_sender: ^5.0.2
  in_app_review: ^2.0.2
  flutter_typeahead: ^4.1.1
  brasil_fields: ^1.5.0
  grouped_list: ^5.1.2
  mat_month_picker_dialog: ^1.0.1

  # Videos Acesso Cameras
  video_viewer: ^1.2.6
  fijkplayer: ^0.10.1

  # Conteudo html
  flutter_html: ^3.0.0-alpha.5

  ## FIREBASE
  firebase_core: ^1.13.1
  firebase_messaging: ^13.0.3
  flutter_local_notifications: ^11.0.1

  ## Share Social
  share: ^2.0.4

  flutter:
    sdk: flutter
  json_serializable: any
  build_runner: any
  freezed: any


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.

dev_dependencies:
  mockito: ^5.0.10
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

flutter_icons:
  android: "ic_launcher"
  ios: true
  image_path: "assets/icon/icon.png"
  adaptive_icon_background: "assets/icon/icon.png"
  adaptive_icon_foreground: "assets/icon/icon.png"

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/img/
    - assets/i18n/
    - assets/animation/loading.riv
    - assets/json/paises.json

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

内容的提问来源于stack exchange,提问作者Breno Rusciolelli

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 15:05:26