Flutter3.7.5解决依赖性错误

flseospp  于 2023-03-04  发布在  Flutter
关注(0)|答案(1)|浏览(167)

我刚刚将flutter从3.3.10更新到3.7.5。
现在每次我运行flutter pub get时,它都会显示解析依赖项。在test1中运行"flutter pub get"...

characters 1.2.1 (1.3.0 available)
  collection 1.17.0 (1.17.1 available)
  connectivity 3.0.6 (discontinued)
  country_code_picker 2.0.2 (discontinued)
  dbus 0.5.4 (0.7.8 available)
  flutter_launcher_icons 0.11.0 (0.12.0 available)
  flutter_layout_grid 1.0.6 (2.0.1 available)
  flutter_local_notifications 9.1.4 (13.0.0 available)
  flutter_local_notifications_linux 0.3.0 (3.0.0+1 available)
  flutter_local_notifications_platform_interface 5.0.0 (6.0.0 available)
  flutter_math_fork 0.5.0 (0.6.3+1 available)
  flutter_svg 0.23.0+1 (2.0.2 available)
  image 3.1.3 (4.0.15 available)
  intl 0.17.0 (0.18.0 available)
  js 0.6.5 (0.6.7 available)
  matcher 0.12.13 (0.12.14 available)
  meta 1.8.0 (1.9.0 available)
  month_picker_dialog_2 0.6.2+1 (discontinued replaced by month_picker_dialog)
  numerus 1.1.1 (2.0.0 available)
  package_info_plus 1.4.3+1 (3.0.3 available)
  package_info_plus_linux 1.0.5 (2.0.0 available)
  package_info_plus_macos 1.3.0 (2.0.0 available)
  package_info_plus_platform_interface 1.0.2 (2.0.1 available)
  package_info_plus_web 1.0.6 (2.0.0 available)
  package_info_plus_windows 2.1.0 (3.0.0 available)
  path 1.8.2 (1.8.3 available)
  path_drawing 0.5.1+1 (1.0.1 available)
  path_parsing 0.2.1 (1.0.1 available)
  petitparser 5.1.0 (5.2.0 available)
  pinput 1.2.2 (2.2.31 available)
  rive 0.9.1 (0.10.2 available)
  share 2.0.4 (discontinued)
  test_api 0.4.16 (0.4.18 available)
  timezone 0.8.0 (0.9.1 available)
  upgrader 3.11.1 (6.0.1 available)
  version 2.0.3 (3.0.2 available)
  webview_flutter 2.8.0 (4.0.5 available)
  webview_flutter_android 2.10.4 (3.3.1 available)
  webview_flutter_platform_interface 1.9.5 (2.0.2 available)
  webview_flutter_wkwebview 2.9.5 (3.1.1 available)
  win32 3.1.3 (4.1.1 available)
  xdg_directories 0.2.0+3 (1.0.0 available)
  xml 5.4.1 (6.2.2 available)Got dependencies!

编译应用程序时显示以下错误
:错误:从" Package :flutter/src/material/bottom_sheet. dart"和" Package :模态底部_sheet/src/bottom_sheet_route. dart"导入了"模态底部纸张路径"。. push(模态底部纸张路径(

^^^^^^^^^^^^^^^^^^^^^

:错误:无法从返回类型为"Future〈T?〉"的异步函数返回类型为"Object?"的值。

  • "对象"来自"dart:core"。
  • "Future"来自"dart:async"。返回结果;^:错误:'模态底部板材路径'同时从' Package :flutter/src/material/bottom_sheet. dart'和' Package :模态底部板材/src/bottom_sheet_route. dart'导入.. push(模态底部板材路径(^^^^^^^^^^^^^^^^^^^^^:错误:无法从返回类型为"Future〈T?〉"的异步函数返回类型为"Object?"的值。
  • "对象"来自"dart:core"。
  • "Future"来自"dart:async"。返回结果;^:错误:从" Package :flutter/src/material/底部_sheet. dart"和" Package :模态底部_sheet/src/底部_sheet_route. dart"导入了"模态底部_sheet_route. dart"。导入"../模态底部_sheet. dart";^^^^^^^^^^^^^^^^^^^^^

目标内核快照失败(_S):例外情况
失败:生成失败,出现异常。

  • 其中:脚本"/用户/lasthoney/开发设置/flutter/包/flutter工具/gradle/flutter. gradle "行:1151
  • 出了什么问题:任务":app:compileFlutterBuildDebug"的执行失败。

进程"命令"/Users/lasthoney/development_setup/flutter/bin/flutter'"已完成,退出值为非零值1

jobtbby3

jobtbby31#

错误源不是flutter pub get本身,因为我看到它确实按预期获得了依赖项,如果代码中没有错误,请尝试运行:

flutter clean
flutter pub get

然后再次运行/构建您的应用。

相关问题