6

I have been struggling now already for 8 month with my Mac Book with M1 Chip and really need to find a solution now. The Cocopods just don't work

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.

What I did so far: Re installing Coco Pods, starting the IDE from Command Line and reinstalling pods. See here : CocoaPods not installed or not in valid state I don't think its related to my Android Studio version.

which pod

/usr/local/bin/pod

flutter doctor -v

[✓] Flutter (Channel stable, 2.10.5, on macOS 11.5.1 20G80 darwin-arm, locale en-ES)
    • Flutter version 2.10.5 at /Users/timknogel/FlutterDev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (8 days ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/timknogel/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.66.0)
    • VS Code at /Users/timknogel/Desktop/Visual Studio Code.app/Contents
    • Flutter extension version 3.38.1

[✓] Connected device (2 available)
    • iPhone 13 (mobile) • 3253AB15-FB90-45F5-93CD-5A95FC029075 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 100.0.4896.127

[✓] HTTP Host Availability
    • All required HTTP hosts are available

Can anybody help?

Thank you so much!

2

5 Answers 5

2

Simply brew install worked for me, after struggling with the gems on MacOS:

brew install cocoapods

Sign up to request clarification or add additional context in comments.

Comments

0

what about this: CocoaPods not installed or not in valid state it like a similar error.

on my case:

  1. switch to best ruby version: rvm --default use 3.1.2
  2. sudo gem install cocoapods
  3. or brew install cocoapods
  4. pod repo update
  5. restart IDE

good luck!

Comments

0

What worked for me, was to set a global ruby version using rbenv or rvm, because for some reason, flutter defaulted to using system ruby which was different from what was being set in my .zshrc file. Which caused the version mismatch for cocoapods.

Comments

0
#!/bin/bash

echo "📦 Installation automatique de CocoaPods pour Mac M1/M2/M3 (Apple Silicon)"

# 1. Vérifier Homebrew
if ! command -v brew &> /dev/null; then
  echo "🚀 Installation de Homebrew..."
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
  echo "✅ Homebrew déjà installé"
fi

# 2. Installer Ruby via Homebrew
echo "💎 Installation de Ruby via Homebrew..."
brew install ruby

# 3. Ajouter Ruby au PATH (évite les conflits avec le Ruby système)
if ! grep -q '/opt/homebrew/opt/ruby/bin' ~/.zshrc; then
  echo '🔧 Configuration du PATH Ruby dans ~/.zshrc'
  echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.zshrc
  source ~/.zshrc
fi

# 4. Installer FFI (si besoin)
echo "📚 Installation du gem ffi..."
sudo gem install ffi -- --enable-libffi-alloc

# 5. Installer CocoaPods
echo "📥 Installation de CocoaPods..."
sudo gem install cocoapods

# 6. Mise à jour des repos CocoaPods
echo "🔄 Mise à jour des sources CocoaPods..."
pod setup

# 7. Aller dans le dossier iOS et faire pod install (si Flutter project détecté)
if [ -d "ios" ]; then
  echo "📁 Dossier iOS trouvé, exécution de pod install..."
  cd ios || exit
  pod install
  cd ..
else
  echo "⚠️ Aucun dossier iOS trouvé. Lance ce script depuis la racine de ton projet Flutter."
fi

echo "✅ Installation terminée. CocoaPods est maintenant prêt à l’emploi !"
pod --version

Comments

-1

follow theese steps:

  1. sudo gem install activesupport -v 6.1.7.6

  2. sudo gem install cocoapods

  3. cd ios

  4. pod install

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.