简体   繁体   中英

flutter depends on firebase_analytics 0.0.4 which requires SDK version >=1.8.0 <2.0.0, version solving failed

Because flutter_chat_app depends on firebase_analytics 0.0.4 which requires SDK version >=1.8.0 <2.0.0, version solving failed. pub get failed (1) exit code 1

 dependencies:
  flutter:
    sdk: flutter
  image_picker: 0.1.1
  google_sign_in: 0.3.1
  firebase_analytics: 0.0.4
  firebase_auth: 0.2.0
  firebase_database: 0.0.12
  firebase_storage: 0.0.5

Your dependency have version constraints that request quite outdated versions of dependencies.

Check each dependency in https://pub.dartlang.org and change the version constraint to versions that allow the version you want

image_picker: ^0.5.0

which allows all version 0.5.x

or

google_sign_in: ^4.0.0

which allows all versions 4.xx

Please note the different effect of ^ for versions that start with 0. vs versions that start with 1. (or any other number other than 0 .

Please also check the CHANGELOG.md tab. Most "official" plugins require you to migrate your project to AndroidX.

Just come down to the issue, you have to add dev dependency. you can add something called dependency override into the pubspec file.

like that :

dependency_overrides:
image_picker: ^0.5.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM