Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Install Firebase Messaging Package

I tried to install Firebase Messaging to an old flutter project but I get this error message

Because firebase_messaging >=7.0.3 <8.0.0-dev.7 depends on firebase_core ^0.5.0+1 and firebase_admob >=0.9.1 <0.10.0-dev.1 depends on firebase_core ^0.4.2+1, firebase_messaging >=7.0.3 <8.0.0-dev.7 is incompatible with firebase_admob >=0.9.1 <0.10.0-dev.1. So, because AppName depends on both firebase_admob ^0.9.3+2 and firebase_messaging ^7.0.3, version solving failed.

pubspec.yaml file

  cupertino_icons: ^0.1.3
  sqflite: ^1.2.1
  path_provider: ^1.6.5
  flutter_local_notifications: ^1.2.1
  firebase_auth: ^0.15.5+2
  google_sign_in: ^4.1.4
  network_to_file_image: ^2.2.8
  shared_preferences: ^0.5.6+2
  firebase_database: ^3.1.3
  url_launcher: ^5.4.2
  share: ^0.6.3+6
  firebase_in_app_messaging: ^0.1.1+3
  auto_direction: ^0.0.4+1
  sliding_up_panel: ^1.0.0
  draggable_scrollbar: ^0.0.4
  firebase_admob: ^0.9.3+2
  provider: ^4.3.2
  pdf: ^1.10.0
  printing: ^3.5.0
  flutter_sms: ^2.0.0+1
  timeline_tile: ^1.0.0

anyone know how to solve this issue?

like image 892
Mohammed Ali Avatar asked May 01 '26 09:05

Mohammed Ali


2 Answers

try removing the version number after the colon ":" from the three sdks.

firebase_messaging: firebase_admob: firebase_core:

then run pub get again

like image 104
Theodore MCA Avatar answered May 03 '26 23:05

Theodore MCA


The firebase_messaging and the firebase_admob package depend on different versions of the firebase_core package.

package required firebase_core version
firebase_messaging ^0.5.0+1
firebase_admob ^0.4.2+1

You can't have both versions. You need to use versions of these two packages that require the same firebase_core version. The newest versions of these two packages require 0.7.0:

https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_messaging/firebase_messaging/pubspec.yaml https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_admob/pubspec.yaml

like image 35
0x4b50 Avatar answered May 03 '26 23:05

0x4b50