我想将firebase_messaging
包添加到我的flutter应用程序中,但当我安装它时,出现了一个错误,它是:
Because firebase_messaging >=7.0.3 <8.0.0-dev.7 depends on firebase_core ^0.5.0+1 and elderly_app depends on firebase_core ^0.7.0, firebase_messaging >=7.0.3 <8.0.0-dev.7 is forbidden.
So, because elderly_app depends on firebase_messaging 7.0.3, version solving failed.
pub get failed (1; So, because elderly_app depends on firebase_messaging 7.0.3, version solving failed.)
我试着安装了两个版本的firebase_messaging
,它们是:
firebase_messaging: ^9.0.0
和firebase_messaging: 7.0.3
并且也出现相同的错误。
这些是我在pubspec.yaml
:中的dependencies
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
ff_navigation_bar: ^0.1.5
calendar_timeline: ^0.7.0
date_time_picker: "^1.1.1"
firebase_core: ^0.7.0
firebase_auth: ^0.20.0+1
cloud_firestore: ^0.16.0
modal_progress_hud: ^0.1.3
datetime_picker_formfield: ^1.0.0
adhan: ^1.1.14
image_picker: ^0.6.7+22
syncfusion_flutter_calendar: ^18.4.42
geolocator: ^6.2.1
fluttertoast: ^7.1.6
geocoder: ^0.2.1
some_calendar: ^1.2.6
flutter_calendar_week:
git:
url: https://github.com/mduccc/flutter_calendar_week
ref: 0.1.0
bubble: ^1.1.9+1
firebase_storage: ^7.0.0
charts_flutter: ^0.9.0
firebase_messaging: 7.0.3
尝试删除版本号并像这样使用:
firebase_messaging:
您必须更新核心版本,同时保持所有firebase产品的最新版本,使用以下最新版本,否则您将面临很多问题:
firebase_messaging: ^9.0.0
firebase_core: ^1.0.1
firebase_auth: ^1.0.1
cloud_firestore: ^1.0.1
你可以通过运行"flutter pub过时"来了解你使用的每个软件包的更新