AVEbrahimi
AVEbrahimi

Reputation: 19164

Flutter: Firebase Analytics not compatible with null safety

I tried to move my project to the new Dart and make it null safety compatible but seems firebase_analytics is still not ready. How can I bypass this error, are they going to release firebase_analytics null safety soon? I filed an issue here: https://github.com/FirebaseExtended/flutterfire/discussions/5108

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  firebase_core: ^0.8.0-1.0.nullsafety.2
  firebase_messaging: ^9.0.0-1.0.nullsafety.1
  firebase_analytics: ^7.0.1
  firebase_crashlytics: ^0.5.0-1.0.nullsafety.3

When I compile I get this error :

Because firebase_analytics >=7.0.1 depends on firebase_core ^0.7.0 and ketab depends on firebase_core ^0.8.0-1.0.nullsafety.2, firebase_analytics >=7.0.1 is forbidden.
So, because yourapp depends on firebase_analytics ^7.0.1, version solving failed.
pub get failed (1; So, because yourapp depends on firebase_analytics ^7.0.1, version solving failed.)

Upvotes: 1

Views: 1646

Answers (1)

Mark Iliev
Mark Iliev

Reputation: 194

FlutterFire by the moment dont have null safety coverage for all of their packages

1 You can fork flutter fire repo https://github.com/FirebaseExtended/flutterfire then you can play with versions in pubspec of firebase_analytics then just use own version like that

firebase_analytics:
    git:
      url: HERE_YOUR_FORKED_REPO_URL
      path: packages/firebase_analytics/firebase_analytics

2 I had familiar problem recently, just removed version at all and now its worked for me))

firebase_auth: ^0.21.0-1.0.nullsafety.0
cloud_firestore: 0.17.0-1.0.nullsafety.2
firebase_analytics: 

Upvotes: 1

Related Questions