WebReinvent Internal Docs
Mac Setup

Cacoapods Setup

Why we don't use Cacoapods from ruby

  • The default Cacoapods from ruby sometimes fail to build apps, which can be build with brew Cocoapods
  • Sometimes Cacoapods from ruby does not work on macos with silicon chip (not sure about this in present time, but earlier this was the issue).
  • If you're using old macos version, the latest version of Cacoapods from ruby might not be supported for you, this could be an issue for the apps that requires newer version of cocoapods.

Install Cacoapods

  1. Switch to the user for which you want to install Cacoapods
  2. Uninstall the local cocoapods (if installed)
gem uninstall cocoapods
  1. (Optional if already installed): Install homebrew
  2. Reinstall cocoapods via Homebrew
brew install cocoapods
  1. Restart the machine.

Cocoapods error on Apple Silicon? (Fix for the users who are running into this, all the other users should be fine)

Optional section

  • This section is optional only users who are facing issue with some specific flutter project shold follow it. Generally it should be followed when users run into issue like
LoadError - dlsym(0x7f8926035eb0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle


Error Description

  • Developer have a Flutter project that they're trying to run on iOS, It runs normally on their Intel-based Mac, but on their new Apple Silicon-based Mac it fails to install pods.

Error log looks something like:

LoadError - dlsym(0x7f8926035eb0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle

Solution

  1. Follow Install Cacoapods first.
  2. Clean the flutter project for which you're having this issue.
  • Run below command in your project
flutter clean
  • And then try running your flutter app.

Copyright © 2024