无法将无酒精鸡尾酒添加到我的Flutter项目

omqzjyyz  于 2023-01-14  发布在  Flutter
关注(0)|答案(2)|浏览(126)

我尝试将mocktail从www.example.com添加pub.dev到pubspec.yaml,但在更新到flutter 3.3.2后无法添加。

environment:
  sdk: ">=2.12.0 <3.0.0"

dev_dependencies:
  flutter_test:
      sdk: flutter

    flutter_lints:
    flutter_launcher_icons: ^0.10.0
    integration_test:
      sdk: flutter
    mocktail:

但问题并没有得到解决。

Error on line 1, column 1 of ..\..\flutter_windows_v1.12.13Base\flutter\.pub-
cache\hosted\pub.dartlang.org\.cache\mocktail-versions.json: Invalid version constraint:
Expected version number after ">=" in ">=2.12-0-0 <3.0.0", got "2.12-0-0 <3.0.0".

pub get failed (65; Error on line 1, column 1 of 
..\..\flutter_windows_v1.12.13Base\flutter\.pub-
cache\hosted\pub.dartlang.org\.cache\mocktail-versions.json: Invalid version constraint:
 Expected version number after ">=" in ">=2.12-0-0 <3.0.0", got "2.12-0-0 <3.0.0".)

Process finished with exit code 65


flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [Version
    10.0.22623.1095], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019
    16.11.10)
[√] Android Studio (version 2021.3)
[√] VS Code (version 1.74.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

• No issues found!
yyhrrdl8

yyhrrdl81#

This answer from River2202对我很有效:
你可以删除/Users/myname/.pub-cache/然后再试一次。当你有多个flutter版本或者安装了不同版本的flutter时,它会缓存一些不同版本的包。

rbl8hiat

rbl8hiat2#

environment:
  sdk: '>=2.18.2 <3.0.0'

相关问题