当前位置:网站首页>Resolving the conflict problem of the flutter Library

Resolving the conflict problem of the flutter Library

2022-06-24 22:04:00 One leaf floating boat

from Git PULL Flutter After the project arrives locally , stay Android Studio In the implementation of :

flutter pub get

newspaper : pub get failed (1; So, because XXXX( Project name ) depends on both flutter_cache_manager 1.2.2 and path_provider ^1.6.24, version solving failed.)  Version solution failed :

  It can be seen from the figure above :requires SDK version >=2.10.0-0.0 <2.12.0 , And I'm here Dart SDKversion nevertheless 2.14.0( my Flutter yes 2.5.2,2.0 There is no such problem below ), Indicates that the library  With the local Dart Version incompatible , If we don't want to upgrade the local SDK Environmental Science , Then you can follow the steps below to select the correct version :

First step : stay pubspec.yaml This dependency is found in the file ,

dependencies
     
  flutter_cache_manager: 1.2.2
  path_provider: ^1.6.24

At this time , We transpose the version any,

dependencies
     
  flutter_cache_manager: any
  path_provider: any

The second step : Command execution   flutter pub get

The third step : open pubspec.lock, This file is used to generate all the manifest files we depend on , You can see ,

  flutter_cache_manager:
    dependency: "direct main"
    description:
      name: flutter_cache_manager
      url: "https://pub.flutter-io.cn"
    source: hosted
    version: "1.4.2"
  path_provider:
    dependency: "direct main"
    description:
      name: path_provider
      url: "https://pub.flutter-io.cn"
    source: hosted
    version: "1.6.9"

The version number changes to 1.4.2 and 1.6.9, This is the version number actually referenced ,

Fourth parts : take 1.4.2 and 1.6.9 Replace the setting just now any The location of ,( Modify one of them . Can rise flutter_cache_manager edition Or drop path_provider edition , This is l flutter_cache_manager edition )

dependencies
     
  # flutter_cache_manager: 1.2.2
  # path_provider: ^1.6.24

  flutter_cache_manager: 1.4.2
  path_provider: ^1.6.24

This perfectly solves the problem .

原网站

版权声明
本文为[One leaf floating boat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241535282744.html