简体   繁体   中英

flutter firebase version solving failed

Because firebase_storage >=2.0.0 depends on firebase_core ^0.3.0 and firebase_auth 0.6.6 depends on firebase_core ^0.2.5+1, firebase_storage >=2.0.0 is incompatible with firebase_auth 0.6.6. And because no versions of firebase_auth match >0.6.6 <0.7.0, firebase_storage >=2.0.0 is incompatible with firebase_auth ^0.6.6. So, because store_manager_erp_next depends on both firebase_auth ^0.6.6 and firebase_storage ^2.1.0+1, version solving failed.


I am new in flutter, please help me to solve this issue

banner: ^0.1.3
  cloud_firestore: ^0.8.2  

  http: ^0.12.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
  #sqflite: any
  sqflite: ^0.13.0+1
  folding_cell: "^0.1.0"
  flutter_rating: ^0.0.2
  firebase_auth:  ^0.6.6
  firebase_database: ^1.0.5 
  firebase_storage: ^2.1.0+1
  fluttertoast: ^2.1.5
  progress_hud: ^1.1.0
  auto_size_text: ^0.3.0
  mongo_dart: ^0.3.4
  google_sign_in: ^3.0.4
  material_search: ^0.2.8
  flutter_secure_storage: ^3.1.2
  modal_progress_hud: ^0.1.2
  flutter_typeahead: ^0.4.1
 # flutter_facebook_login: ^1.1.1
  flutter_firebase_ui: ^0.0.13
  json_serializable: ^2.0.1
  flutter_spinkit: "^3.1.0"
  shared_preferences: ^0.4.3
  flutter_html: ^0.8.2
  #pinch_zoom_image: "^0.2.5"
  #photo_view: ^0.2.0
  splashscreen: ^1.1.0
  #shared_preferences: ^0.4.3
  badges: ^0.0.6

Change

 firebase_auth:  ^0.6.6

to

 firebase_auth:  ^0.8.0

You might also need to check other dependencies if the constraints are outdated.

You can also use the workaround mentioned in https://github.com/flutter/flutter/issues/12627#issuecomment-400037580

export FLUTTER_ROOT="/Users/something/flutter"
pub upgrade

to get information for what dependencies updates are available.

just add this line of code in your pubspec

dependency_overrides:
  firebase_core: 0.3.0

this will override the dependency, and you can use whatever version you want. you might need to change it the version of the package.

my code example:

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.0
  file_picker: ^3.0.0
  hive: ^2.0.0
  hive_flutter: ^1.0.0

dependency_overrides:
  path_provider: 2.0.1

You need to migrate your project to AndroidX . Please see the following documentation for detailed steps on it...

Migrate to Android X

Or else, just downgrade the firebase_auth version to the old version that works fine without androidX migration

请参阅此链接https://github.com/FirebaseExtended/flutterfire/issues/4650并将您的项目版本替换为相应的版本

Try run pub get by omitting the version name of the package which is causing you the issue like this

firebase_storage:

This will get you out the issue.

you can downgrade your google sign in version to stable one like

google_sign_in: ^4.5.9

to know the most stable one go to

https://pub.dev/packages/google_sign_in/versions

and choose latest one before beta version pubspec.yaml file

environment: sdk: ">=2.12.0 <3.0.0"

dependencies: flutter: sdk: flutter

cupertino_icons: ^1.0.2 get: ^4.2.4 google_sign_in: ^4.5.9 firebase_core: "0.7.0" firebase_auth: "^0.20.1"

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