Xcode: 12.2, Build version 12B45b
Android Studio: 4.1.1
I made an app in Android Studio, it compiles fine. But a lot trouble happened after I add
firebase_core: ^0.5.2+1 firebase_auth: ^0.18.3+1 cloud_firestore: ^0.14.3+1
pubspec.yaml, run app, it says
Error running pod install.
I thought it's maybe the versions issue, so I downgrade each one to
firebase_core: ^0.3.4 firebase_auth: ^0.8.4+4 cloud_firestore: ^0.9.13+1
Then I folloed Paresh Mangukiya's answer to try something further
### Open terminal, go to the project's folder cd /ios rm Podfile.lock pod install --repo-update flutter clean
Then I add the three dependencies one by one.
firebase_core: ^0.5.2+1, run app in simulator, OK.
firebase_auth: ^0.18.3+1, run app, it says
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update
pod repo update, then run app again, OK.
cloud_firestore: ^0.9.13+1, run app, it says
Error running pod install again, without any more info.
Then I believe it's the problem of
cocoapods itself. I followed neilco's answer to fully uninstall cocoapods
gem list --local | grep cocoapods sudo gem uninstall EACH_OF_THEM rm -rf ~/.cocoapods
Then, I installed
homebrew and reinstalled
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install cocoapods
After that, redo the steps
### Open terminal, go to the project's folder cd /ios rm Podfile.lock pod install --repo-update
It stuck at
Installing BoringSSL-GRPC (0.0.7). I waited about 1 hour, it still stuck there.
After read Nitish Kumar Singh's post, I know
It downloads more than 1 GB of data when you Firebase(Firestore) to the Flutter Project. This is the reason why it took so long to finish.
After about 3 hours, downloaded a bunch of dependencies
Installing BoringSSL-GRPC (0.0.7) Installing Firebase (6.33.0) Installing FirebaseAuth (6.9.2) Installing FirebaseCore (6.10.3) Installing FirebaseCoreDiagnostics (1.7.0) Installing FirebaseFirestore (1.18.0) Installing Flutter (1.0.0) Installing GTMSessionFetcher (1.5.0) Installing GoogleDataTransport (7.5.1) Installing GoogleUtilities (6.7.2) Installing PromisesObjC (1.2.11) Installing abseil (0.20200225.0) Installing cloud_firestore (0.14.3-1) Installing firebase_auth (0.18.3-1) Installing firebase_core (0.5.2-1) Installing gRPC-C++ (1.28.2) Installing gRPC-Core (1.28.2) Installing leveldb-library (1.22) Installing nanopb (1.30906.0)
After a crazy
232.2s build time, run successfully.
Actually I am still not sure what caused the issue after all. But reinstall cocoapods helps in my case.
Hope this helps!
So proud to be a coder!