flutter - 运行flutter pub升级的错误在5分钟后停止

标签 flutter dart yaml flutter-web

一周后,我做了flutter cleanflutter pub upgrade,在运行flutter run -d web-server时,我得到了在5.2分钟后停止的错误。我非常确定错误的原因是flutter pub upgrade。但是我不确定到底是哪个包引起了错误
我的pubspec.yaml文件看起来像这样

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  provider: ^4.3.2+1
  provider_architecture: ^1.1.1+1
  date_format: ^1.0.8
  shared_preferences: ^0.5.7+1
  firebase_storage: ^4.0.0
  image_picker:
  flutter_web_image_picker: ^0.0.2
  path: ^1.7.0
  mime_type: ^0.3.2
  camera:
  path_provider:
  dcdg: ^2.0.1
  intl: ^0.16.1
  photo_view:
  image_cropper:
  flutter_swiper:
  flutter_custom_dialog: ^1.0.20
  awesome_dialog: ^1.1.3
  timer_count_down: ^1.0.4+1
  age: ^0.0.1
  animator: ^2.0.1

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

  async_builder: ^1.2.0
  get_it:
  logger: ^0.7.0+2

  # For designing
  device_preview: ^0.4.3
  carousel_slider: ^1.0.1
  eva_icons_flutter: ^1.0.4
  fleva_icons:
  flutter_spinkit: ^4.1.2
  sleek_circular_slider: ^1.1.0
  flutter_rating_bar: ^1.1.0
  searchable_dropdown: ^1.1.3
  carousel_pro: ^1.0.0
  dropdown_search:
  animated_widgets: ^1.0.6
  flutter_animator: ^2.1.0
  lite_rolling_switch: ^0.1.1
  dropdown_formfield: ^0.1.2
  string_validator: ^0.1.4
  image_picker_web_redux: ^1.1.0+2
  # image_picker_web: any
  universal_html: ^1.2.3
  random_string: ^2.1.0
  # Add the dependency for the FlutterFire plugin for Google Analytics
  firebase_analytics: ^5.0.2
  cloud_functions:
  # Add the dependencies for any other Firebase products you want to use in your app
  # For example, to use Firebase Authentication and Cloud Firestore
  firebase_auth: ^0.18.0+1
  cloud_firestore: ^0.14.0+2
  firebase: ^7.3.0
  firebase_auth_web:
  otp: 2.2.1
  flutter_otp: ^0.3.2
  # To obtain R E D U X store for DB
  flutter_redux: ^0.6.0
  redux_thunk: ^0.3.0
  http: ^0.12.0+4
  redux_persist: ^0.8.4
  redux: ^4.0.0+3
  redux_epics: ^0.14.0
  woocommerce: ^0.9.7
  
  

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

  #provider package

dev_dependencies:
  flutter_test:
    sdk: flutter

错误是这样的。看起来上面的文本未能编译,消息持续重复了5分钟。
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:434:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx, Pointer<IntPtr> ppEnum) =>
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:434:44: Error: 'IntPtr' isn't a type.
          Pointer<COMObject> pCtx, Pointer<IntPtr> ppEnum) =>
                                           ^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:434:36: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx, Pointer<IntPtr> ppEnum) =>
                                   ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:435:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_CreateInstanceEnum_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:435:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_CreateInstanceEnum_Native>>.fromAddress(
      ^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:440:31: Error: 'Pointer' isn't a type.
  int CreateInstanceEnumAsync(Pointer<Utf16> strFilter, int lFlags,
                              ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:441:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx, Pointer<COMObject> pResponseHandler) =>
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:441:36: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx, Pointer<COMObject> pResponseHandler) =>
                                   ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:442:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_CreateInstanceEnumAsync_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:442:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_CreateInstanceEnumAsync_Native>>.fromAddress(
      ^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:447:17: Error: 'Pointer' isn't a type.
  int ExecQuery(Pointer<Utf16> strQueryLanguage, Pointer<Utf16> strQuery,
                ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:447:50: Error: 'Pointer' isn't a type.
  int ExecQuery(Pointer<Utf16> strQueryLanguage, Pointer<Utf16> strQuery,
                                                 ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:448:23: Error: 'Pointer' isn't a type.
          int lFlags, Pointer<COMObject> pCtx, Pointer<IntPtr> ppEnum) =>
                      ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:448:56: Error: 'IntPtr' isn't a type.
          int lFlags, Pointer<COMObject> pCtx, Pointer<IntPtr> ppEnum) =>
                                                       ^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:448:48: Error: 'Pointer' isn't a type.
          int lFlags, Pointer<COMObject> pCtx, Pointer<IntPtr> ppEnum) =>
                                               ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:449:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_ExecQuery_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:449:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_ExecQuery_Native>>.fromAddress(
      ^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:455:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strQueryLanguage,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:456:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strQuery,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:458:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:459:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pResponseHandler) =>
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:460:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_ExecQueryAsync_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:460:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_ExecQueryAsync_Native>>.fromAddress(
      ^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:466:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strQueryLanguage,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:467:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strQuery,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:469:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:470:19: Error: 'IntPtr' isn't a type.
          Pointer<IntPtr> ppEnum) =>
                  ^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:470:11: Error: 'Pointer' isn't a type.
          Pointer<IntPtr> ppEnum) =>
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:471:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_ExecNotificationQuery_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:471:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_ExecNotificationQuery_Native>>.fromAddress(
      ^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:477:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strQueryLanguage,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:478:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strQuery,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:480:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:481:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pResponseHandler) =>
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:482:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_ExecNotificationQueryAsync_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:482:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_ExecNotificationQueryAsync_Native>>.fromAddress(
      ^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:488:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strObjectPath,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:489:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strMethodName,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:491:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:492:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pInParams,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:493:19: Error: 'IntPtr' isn't a type.
          Pointer<IntPtr> ppOutParams,
                  ^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:493:11: Error: 'Pointer' isn't a type.
          Pointer<IntPtr> ppOutParams,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:494:19: Error: 'IntPtr' isn't a type.
          Pointer<IntPtr> ppCallResult) =>
                  ^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:494:11: Error: 'Pointer' isn't a type.
          Pointer<IntPtr> ppCallResult) =>
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:495:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_ExecMethod_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:495:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_ExecMethod_Native>>.fromAddress(
      ^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:501:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strObjectPath,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:502:11: Error: 'Pointer' isn't a type.
          Pointer<Utf16> strMethodName,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:504:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pCtx,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:505:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pInParams,
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:506:11: Error: 'Pointer' isn't a type.
          Pointer<COMObject> pResponseHandler) =>
          ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:507:15: Error: 'NativeFunction' isn't a type.
      Pointer<NativeFunction<_ExecMethodAsync_Native>>.fromAddress(
              ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.3/lib/src/generated/IWbemServices.dart:507:7: Error: Method not found: 'Pointer.fromAddress'.
      Pointer<NativeFunction<_ExecMethodAsync_Native>>.fromAddress(
      ^^^^^^^^^^^
Syncing files to device Web Server...                           314,838ms (!)
Failed to compile application.

最佳答案

更新路径如下所示:

dependencies:
  path_provider: 1.6.14
ref
github/issue/66143

关于flutter - 运行flutter pub升级的错误在5分钟后停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63988924/

相关文章:

Flutter:获取 print() 语句的行号,Android Studio

flutter - 使用flever常量最佳实践,而不是使用dependentOnInheritedWidgetOfExactType。

kubernetes - 使用 NodeSelector 验证 Pod 模板时出错

amazon-web-services - 在 Cloudformation 中实现此条件时,为什么我会看到 'did not find expected node content'?

android - Flutter 上的小部件的 onResume() 和 onPause()

python - 使用 Python 读取 YAML 文件导致 AttributeError

firebase 与 flutter 的集成在地理位置依赖性方面不成功

java - 解决 flutter 中的调试问题

dart - 如何更改最小化时出现的flutter应用程序的主题

android - Flutter:前台通知在 Firebase 消息传递中不起作用