How to use cocoapods in a flutter project - flutter

I have been trying to use Firebase. After trying to run the app on the IOS simulator, it giving this error
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
CocoaPods not installed or not in valid state.
Error launching application on iPhone 12 Pro Max.
The problem is also I cannot run flutter doctor since even if it is in the path it saying flutter command not found and I have tried every solution in vain.
I went on to try removing pod file and reinstalling it using pod install and everything worked well but still it is not working. I updated cocoapods using brew because it wasn't working using gem and did the the same to ruby but still it is not working
I don't know which piece of the project I should show
Any help will be appreciated.

I encounter the same problem regularly.
The solutions if found here usually work for me:
https://stackoverflow.com/a/64676861/6704033
Solution: 1
Following this command to update your pod
flutter clean
pod repo update
deleted /ios/Pods/ and /ios/Podfile.lock
run pod install
Solution: 2
first pod repo update
rm -rf Podfile.lock
pod install
Also restarting my IDE fixes it sometimes.

Related

No podspec found for `flutter_user_agentx` in `.symlinks/plugins/flutter_user_agentx/ios`, while running application on ios. Android is working

I am trying to run my flutter application in ios, and while pod installs I am getting an error ([!] No podspec found for flutter_user_agentx in .symlinks/plugins/flutter_user_agentx/ios). I am using a dependency named "flutter_user_agentx", On android is working fine, a Few days back it was working fine for ios also but today I am getting this error.
I want to run my flutter application on ios.
This usually happens when you add a new package and there are no pods for ios for that package. However, you will get a lot of pods problem, but mostly following these steps will solve them:
run flutter clean
Delete the following files in the ios folder: Podfile and Podfile.lock and the folder Pods
run flutter pub get
go to the 'ios' folder using cd ios
run pod install --repo-update (to install the pods again, and if u face any problem try without --repo-update)
Run your app, from command line using 'flutter run' which will take a little bit longer
It seems that package is broken in iOS.It's a fork of the original repo. Not the official one.
Use the below package instead.
https://pub.dev/packages/fk_user_agent
GitHub issue link

CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core" [duplicate]

I am making a React-Native mobile application and want to incorporate Firebase and Firebase Authentication. However, I am facing this error when I run 'pod install' or 'pod update':
I did some research and found out that this issue has not yet been resolved by Google (https://issuetracker.google.com/issues/254418199), but I came across a workaround (https://github.com/firebase/firebase-ios-sdk/issues/10359) which said to add a version specifier to the Podfile: pod 'FirebaseAuth', '>= 9.6.0'. However, even after I added the line into the Podfile in my iOS folder, the same error still persists. May I know if I'm doing something wrongly?
I stumbled upon the same issue. It seems it's a compatibility issue with the latest Firesbase SDK version (10).
For now something that worked for me is to place this at the top of the Podfile:
$FirebaseSDKVersion = '9.6.0' (Docs)
This overrides the default firebase sdk and assures it uses the downgraded version.
Now just execute pod install and give a try. If it doesn't work try removing the Podfile.lock and the Pods folder and try again.
BTW I didn't need this line in the Podfile as one of the resources you shared mentioned:
pod 'FirebaseAuth', '>= 9.6.0'
What helped me is to add this into my pod file.
pod 'GTMSessionFetcher', :modular_headers => true
and then run
arch -x86_64 pod update GTMSessionFetcher/Core
Unfortunately, while Alex's answer did help with my original error, I was unable to solve the 2nd error in my comment above. What I did instead was to restart the creation of the app. This time, however, rather than connecting the app to Dialogflow first, I linked the app to Firebase Auth first, and then adding Dialogflow. This worked for me and I managed to build the app with no issues. Hope this helps someone.
try to delete Podfile.lock and run cd ios && pod install --repo-update

An error while processing the post-install hook of the Podfile

i am trying to debug my flutter project in mac simulator. My mac is mac m1. I am facing error:Error running pod install while doing flutter run. please help
I've come up with this issue before but can't recall which solution fixed it.
Try deleting the Pods file under the ios directory. Then in terminal, change your working directory to ios in your project. Write pod install then if it doesn't help try running pod repo update.

Getting Errors Installing Pods

I am having an issue with my xcode project that it is not installing any new pods. I installed the same library on another project and it is working there. the terminal give me the following error when I use
pod install
I also update my cocoapods to version 1.11.0 but still getting this error.
Does anyone know any solution?

Can't Install latest version of Cocoapods

I'm not sure how, but I managed to install version 1.8.4 of cocoapods. However, I can't update it. I need to update it because the pods for the firebase google sign in require FirebaseAnalytics, and Firebase Analytics requires cocoapods to be 1.10.0. Whenever I try to update it, either by simply sudo gem install cocoapods or sudo gem update cocoapods, I get the following error:
The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.
This is odd because I do in fact have xcode developer tools installed.
And here are the pods (one of which requires FirebaseAnalytics)
Also see the error message:
This question is similar to several others--I'm asking a new question because the answers to those questions didn't help me and the questions were fairly old, so I doubt I'll get any help there.
I greatly appreciate your help. This problem alone is stopping me from using Firebase's google sign in in my application.
EDIT:
After I re-installed cocoapods with brew I checked my pod version, only to find that it was still 1.8.4. I then ran brew upgrade cocoapods and everything seemingly looked up to date. But I checked the version once more and am still seeing 1.8.4. What is going on here?
EDIT 2: bundle result
I was able to successfully (seemingly) install bundle, but I'm getting errors when I try to use bundle to install / update cocoapods.
EDIT 3: Solution Found?
I tried upgrading cocoapods again with brew, and for some reason it worked this time--even though last time I tried upgrading cocoapods with brew it didn't work. (Did bundle help?) I still have yet to see if this solves my original problem, but cocoapods is now version 1.11.2, the newest version. Thanks for all the help!
I think you are using the latest Xcode. just make sure your system cocoa pods up to date with the latest version. so just try this command in your terminal sudo gem install cocoapods and again try to install.
because firebase requirements in their website
You can also try - install swift package instead of pods it will also work