fluttercocoapodsfvm

Cocoapods installed but doesn't work. FVM and Cocoapods issue


I'm trying to launch a 2 y/o Flutter project which depends on a whole lot of old packages that hadn't been updated for a long time, thus I must launch it on Flutter 2.8.1 using FVM and older version of CocoaPods which is 1.12.1, but, for some reason, FVM won't recongnize my Cocoapods.

At first the issue was with pods version, I managed to install older version of it. But now, when I try to launch my project with fvm flutter run I get an error

fvm flutter run -d F580B7B0-B930-403C-96A4-C366472BE604 --flavor preprod -t lib/main_preprod.dart

Launching lib/main_preprod.dart on iPhone 12 Pro in debug mode...
Warning: CocoaPods is installed but broken. Skipping pod install.
  You appear to have CocoaPods installed but it is not working.
  This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
  This can usually be fixed by re-installing CocoaPods.
To re-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.

I tried to install pods directly into fvm/versions/2.8.1/bin, but it doesn't work.

I deleted Flutter to use FVM only.


Solution

  • Use this commands in your terminal

    sudo gem install cocoapods-deintegrate cocoapods-clean
    pod deintegrate
    pod cache clean --all
    rm Podfile
    rm Podfile.lock 
    

    And re-install cocoapods using this command

    sudo gem install cocoapods
    

    Answer reference