如何解决Flutter中的版本控制

时间:2019-05-09 06:24:19

标签: android-studio dart flutter flutter-dependencies flutter-packages

我想将url_launcher软件包添加到pubspec.yml中的flutter文件中。

pubspec.yml的代码

name: url_launch_app
description: A new Flutter application.


version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  #url_launcher: '>=0.1.2 <0.2.0'
  url_launcher: '^0.4.1'

我已为url_laucher添加了程序包,但单击packages get时遇到以下错误。

错误:

Running "flutter packages get" in url_launch_app…

The current Dart SDK version is 2.3.0-dev.0.1.flutter-cf4444b803.

Because url_launch_app depends on url_launcher >=0.1.1 <3.0.0 which requires SDK version <2.0.0, version solving failed.

pub get failed (1)
Process finished with exit code 1

如何解决此版本错误?

1 个答案:

答案 0 :(得分:1)

替换您的

url_launcher: '^0.4.1'

通过

url_launcher: ^5.0.2