【问题标题】:clone the old flutter project and it is not working, any thoughts how to fix this克隆旧的颤振项目,它不工作,任何想法如何解决这个问题
【发布时间】:2021-10-31 16:15:11
【问题描述】:

我已经克隆了这个项目https://github.com/2d-inc/developer_quest 当我尝试在 android 上运行项目时,出现以下错误

The current Dart SDK version is 2.15.0-42.0.dev.

因为 test >=1.16.0-nullsafety =2.10.0-0 =1.16.0-nullsafety.8 =1.3.0-nullsafety =1.16.0-nullsafety =1.3.0-nullsafety =1.16.0-nullsafety.18 =1.3.0 =1.3.0 =1.16.0-nullsafety =1.3.0-nullsafety =1.12.0 =1.13.0 =1.3.0 =1.16.0-nullsafety =1.3.0-nullsafety =1.14.5 =1.15.0 =1.3.0 =1.16.0-nullsafety =1.3.0-nullsafety =1.15.3 =1.15.5 =1.3.0 =1.3.0-nullsafety =1.16.0-nullsafety.19 =1.3.0 =1.3.0-nullsafety =1.3.0 =1.16.6 依赖于 webkit_inspection_protocol ^1.0.0,它依赖于记录 ^1.0.0,如果来自 sdk 的 flutter_test 和来自 sdk 的任何 flutter_driver 并且 test >=1.3.0 然后记录 ^1.0.0。 并且因为 dev_rpg 依赖于来自 sdk 的 flutter_test any 和来自 sdk 的 flutter_driver any,所以 test >=1.3.0 需要记录 ^1.0.0。 因此,因为 dev_rpg 依赖于记录 ^0.11.3+2 和测试 ^1.6.1,所以版本求解失败。 在 developer_quest 中运行“flutter pub get”...
pub get failed (1; 所以,因为 dev_rpg 依赖于 logging ^0.11.3+2 和 test ^1.6.1,版本求解失败。)

这是我的 pubspec.yaml 文件代码

    name: dev_rpg
description: Become a tech lead, slay bugs, and don't get fired.

# 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.
# Read more about versioning at semver.org.
version: 1.0.0+1

environment:
  # For Google I/O we are being very specific about pinning to specific branch revision.
  # This is flutter commit hash b593f5167bce84fb3cad5c258477bf3abc1b14eb, tagged
  # as Flutter version 1.5.4.
  sdk: ">=2.3.0-dev.0.1 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  intl: any
  provider: ^2.0.0

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  flare_flutter: ^1.8.3
  auto_size_text: ^1.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_driver:
    sdk: flutter
  logging: ^0.11.3+2
  git: ^0.5.1+1
  t_stats: ^2.0.0
  test: ^1.6.1


# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/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:
    - assets/style_sphinx/
    - assets/images/
    - assets/images/2.0x/
    - assets/images/3.0x/
    - assets/flare/
    - assets/docs/code_chomper_alpha.dart
    - assets/docs/code_chomper_beta.dart

  fonts:
      - family: SpaceMonoRegular
        fonts:
          - asset: assets/fonts/SpaceMono-Regular.ttf
      - family: SpaceMonoBold
        fonts:
          - asset: assets/fonts/SpaceMono-Bold.ttf
      - family: RobotoCondensedBold
        fonts:
          - asset: assets/fonts/RobotoCondensed-Bold.ttf
      - family: RobotoRegular
        fonts:
          - asset: assets/fonts/Roboto-Regular.ttf
      - family: MontserratMedium
        fonts:
          - asset: assets/fonts/Montserrat-Medium.otf
      - family: MontserratRegular
        fonts:
          - asset: assets/fonts/Montserrat-Regular.otf
      - family: MontserratBold
        fonts:
          - asset: assets/fonts/Montserrat-Bold.otf

我试过升级

flutter channel dev 
flutter create .  ```

【问题讨论】:

  • 您应该按照开发者指南将项目转换为 Flutter 2。

标签: flutter flutter-dependencies flutter-animation


【解决方案1】:

正如错误所说,该项目有一些依赖项,您拥有的 Flutter 版本没有满足这些依赖项(因为 Flutter 本身附带的库)。

项目的pubspec.yaml 说它应该与flutter 版本 1.5.4. 一起工作,所以如果你想运行那个项目,你需要下载兼容的flutter sdk

【讨论】:

  • 我现在通过 fvm 安装了颤振 1.5.4 仍然没有运气。现在我得到了 dart 版本错误和 gradle build 错误。
  • 尝试 `sdk: ">=2.3.0
  • 在使用 `sdk: ">=2.3.0 ../flutter/.pub-cache/hosted/pub.dartlang.org/provider-2.0.1+1/lib/src/provider.dart:179:54: Error: 'Name' isn't a type. ? context.dependOnInheritedWidgetOfExactType<Name>(type) as _Provider<T 时遇到此错误
猜你喜欢
  • 2021-11-29
  • 1970-01-01
  • 2020-01-16
  • 1970-01-01
  • 2022-01-12
  • 1970-01-01
  • 1970-01-01
  • 2021-08-11
  • 2021-02-10
相关资源
最近更新 更多