android - 最近更新后,pug get 无法正常工作。有任何想法吗?

标签 android android-studio flutter dart

今天(22.08.2020)在 Android Studio 上被提示后,我更新了 flutter 。之后,每当我执行 pub get 时,我都会收到以下错误:
“因为来自 sdk 的 flutter 的每个版本都依赖于与任何版本都不匹配的 vector_math 2.1.0-nullsafety.2,所以禁止来自 sdk 的 flutter 。
所以,因为flutter_app3依赖于来自sdk的flutter any,所以版本解析失败了。
pub get failed (1; 所以,因为flutter_app3依赖于来自sdk的flutter any,版本解析失败。)"
请参阅下面的 flutter 医生 -v 结果:

C:\Users\User\StudioProjects\flutter_app3>flutter doctor -v
[√] Flutter (Channel beta, 1.21.0-9.1.pre, on Microsoft Windows [Version 10.0.17134.1667], locale cs-CZ)
• Flutter 版本 1.21.0-9.1.pre,位于 C:\src\flutter
• 框架修订be9bc8cb39(4天前),2020-08-18 09:46:08 -0700
• 引擎版本 267070c17a
• Dart 版本 2.10.0(构建 2.10.0-7.2.beta)
[√] Android 工具链 - 为 Android 设备开发(Android SDK 版本 29.0.2)
• Android SDK 位于 C:\Users\User\AppData\Local\Android\sdk
• 平台 android-29,构建工具 29.0.2
• Java 二进制文件位于:C:\Program Files\Android\Android Studio\jre\bin\java
• Java 版 OpenJDK 运行时环境(内部版本 1.8.0_242-release-1644-b01)
• 接受所有Android 许可证。
[√] Android Studio(4.0版)
• C:\Program Files\Android\Android Studio 中的 Android Studio
• Flutter 插件版本 48.1.2
• Dart 插件版本 193.7361
• Java 版 OpenJDK 运行时环境(内部版本 1.8.0_242-release-1644-b01)
[√] VS Code(1.47.2版)
• C:\Users\User\AppData\Local\Programs\Microsoft VS 代码中的 VS 代码
• Flutter 扩展版本 3.12.2
[√] 已连接设备(1 个可用)
• HD1903(移动) • aa3eee24 • android-arm64 • Android 10 (API 29)
• 未发现任何问题!
pubspec.yaml:

name: flutter_app3
description: A new Flutter application.

# 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

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter


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

dev_dependencies:
  flutter_test:
    sdk: flutter

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

# 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:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # 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

提前致谢。

最佳答案

您使用了 channel 测试版 flutter 。
我认为您需要使用稳定的 channel 。

关于android - 最近更新后,pug get 无法正常工作。有任何想法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63539978/

相关文章:

charts - 有没有办法在 TimeSeries Flutter 图表上设置笔划宽度?

flutter - Dart 中的多级 map 或 map 列表?

android-studio - Flutter Doctor 发现问题 Android_Home

android - 在设置背景资源后将位图设置为 ImageView

android - 是否可以实现默认的 soundcloud 用户?

android - 从缓存目录播放音频

android - 更新到 Android Studio 北极狐后,我无法使用任何自定义主题

android - 如何在 Android Studio 中检查代码圈复杂度?

Android App Bundle 构建失败

android - Android Studio中的Gradle同步错误在根项目上给出错误