Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudFirestorePlugin fails to compile on IOS

Tags:

flutter

I have a running app on Android, which is using a few plugins including cloud_firestore. Trying to compile for IOS it fails with

Xcode's output: ↳

 === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    /ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'cloud_firestore/CloudFirestorePlugin.h' file not found
    #import <cloud_firestore/CloudFirestorePlugin.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

I know very little about IOS. Can someone tell me why this is happening?

like image 683
Arash Avatar asked Apr 27 '18 04:04

Arash


2 Answers

For flutter, you don't do any manual pod update. Just do the following 3 steps

  1. Add GoogleService-Info.plist file using xcode
  2. Change pubspec.yaml file with adding cloud_firestore: as a dependency
  3. Change code for importing Firebase (Swift / Objective C)

NOTE: Don't do any pod install step whatever is mentioned in Firebase. This is not required in flutter.

Build you App, Pod install will happen automatically and your code will run.

I've did this multiple times and it works all the time

Hope it helps

like image 199
Deepak Kr Gupta Avatar answered Nov 11 '22 16:11

Deepak Kr Gupta


Try this. When opening the project in XCode, make sure you open the file with the .xcworkspace extension instead of the one with .xcodeproj and then build again.

like image 40
Naj Avatar answered Nov 11 '22 18:11

Naj