fluttermacoscocoapods

Circular Flutter error running pod repo update followed by flutter run


On a mac m2 running flutter build macos fails with the error

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update

Running pod repo update does not fix the problem. I have tried rm -rf ios/Pods, flutter clear and flutter pub get but nothing seems to work. I have tried all the solutions I can find here but still the same error. This project was created on ubuntu 22.04 and I'm trying to run it on my mac mini m2. It has FlutterFire deps but I have run the update command in the cli.


Solution

  • I have solved this problem, I hope it helps! My solution: Manually clone CocoaPods specification library.

    cd ~/.cocoapods/repos 
    git clone github.com/CocoaPods/Specs.git cocoapods 
    

    Locate the Profile file in the project /ios folder and add the following reference to the file:

    source '~/.cocoapods/repos/cocoapods'
    

    ~ Change to your own .cocoapods directory.

    Perform again:

    pod install