Hridyansh Pareek
Hridyansh Pareek

Reputation: 11

Firebase cloud_firestore version issue in Flutter - iOs M1

I've been trying to run my flutter project in iOs emulator iPhone 12. But, the version dependancy issue haven't been resolved by any answer or suggestion I've found over StackOverflow or Github.

The issue I'm facing is:

[!] CocoaPods could not find compatible versions for pod "FirebaseCore":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 2.5.3, which depends on
      Firebase/Firestore (= 8.7.0) was resolved to 8.7.0, which depends on
        FirebaseFirestore (~> 8.7.0) was resolved to 8.7.0, which depends on
          FirebaseCore (~> 8.0)

    firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.7.0, which depends on
      Firebase/CoreOnly (= 8.7.0) was resolved to 8.7.0, which depends on
        FirebaseCore (= 8.7.0)

CocoaPods could not find compatible versions for pod "nanopb":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 2.5.3, which depends on
      Firebase/Firestore (= 8.7.0) was resolved to 8.7.0, which depends on
        FirebaseFirestore (~> 8.7.0) was resolved to 8.7.0, which depends on
          nanopb (~> 2.30908.0)

    firebase_admob (from `.symlinks/plugins/firebase_admob/ios`) was resolved to 0.11.2, which depends on
      Google-Mobile-Ads-SDK (= 7.49.0) was resolved to 7.49.0, which depends on
        GoogleAppMeasurement (~> 6.0) was resolved to 6.1.2, which depends on
          nanopb (~> 0.3)

Pubsec.yaml file:

version: 3.0.5+11

environment:
  sdk: ">=2.10.5 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^0.13.0+1 #^2.2.1 #^0.14.3 #https://pub.dev/packages/cloud_firestore
  firebase_auth: ^1.0.0 #https://pub.dev/packages/firebase_auth
  firebase_auth_web: ^1.0.0 #https://pub.dev/packages/firebase_auth_web/
  firebase_core: ^1.2.1 #https://pub.dev/packages/firebase_core
  firebase_messaging: ^9.0.0 #^10.0.1 #^7.0.3 #https://pub.dev/packages/firebase_messaging
  firebase_storage: ^8.1.1 #https://pub.dev/packages/firebase_storage
  # flutter_html: ^2.1.0 #https://pub.dev/packages/flutter_html
  # flutter_widget_from_html: ^0.8.2 
  google_sign_in: ^5.0.0 #^4.5.6 #https://pub.dev/packages/google_sign_in
  # firebase_analytics: ^7.1.0 #https://pub.dev/packages/firebase_analytics
  firebase_admob: ^0.11.2 #https://pub.dev/packages/firebase_admob

I've tried some versions of cloud_firestore from FlutterFire's GitHub issues. The issue persists when I run the command pod update and the command flutter pub get works fine. The device is MacBook Pro M1 and I've also installed the ffi from this answer. But, the project doesn't run on the iOs emulator.

Upvotes: 1

Views: 977

Answers (1)

BLKKKBVSIK
BLKKKBVSIK

Reputation: 3548

You can try the following:

Firstly, in your Podfile change the platform :ios target from 9.0 to 10.0.

Then, you can try to run the arch -x86_64 pod update command line.

Upvotes: 3

Related Questions