CocoaPods: ffi / ruby error on Apple silicon iOS Origin: On your device OSI layer 7 · Application Last updated 25 Nov 2026

LoadError - dlopen(ffi_c.bundle) (LoadError) incompatible architecture (have 'x86_64', need 'arm64e')

CocoaPods' native gem was built for another CPU architecture.

Exact message you may see dlopen ffi_c.bundle incompatible architectureLoadError ffi pod install arm64CocoaPods ffi error Apple siliconLoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried: incompatible architecture (have 'x86_64', need 'arm64e')
Seen on: iOS macOS

Meaning

Reinstall CocoaPods under the Ruby you use now (gem install cocoapods or brew install cocoapods), or run Terminal under Rosetta consistently. Avoid mixing arm64 and x86_64 Ruby.

Common causes

  • Rosetta/arm64 mix
  • Old system Ruby gems
  • Homebrew migrated

⚡ Quick fix

  1. sudo gem install ffi or brew reinstall cocoapods
  2. Use rbenv with arm64 Ruby
  3. Reopen terminal without Rosetta

Detailed fix by platform

Shell

  1. swift
    brew reinstall cocoapods
    pod --version

How to diagnose

  1. Arch — arm64/x86?
  2. Ruby — which?
  3. Gems — rebuilt?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

CDN: trunk URL couldn't be downloaded — [!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/... (iOS)CDN: trunk URL couldn…CocoaPods compatible versions — CocoaPods could not find compatible versions for pod (iOS)CocoaPods compatible …CocoaPods: pod install failed / not installed — Flutter iOS: Error running pod install — CocoaPods not installed or out of date / [!] CocoaPods could not find compatible versions for pod (Flutter / Dart)CocoaPods: pod instal…library not found for -lPods — ld: library not found for -lPods-AppName / framework not found Pods_App (iOS)library not found for…mach-o file, but is an incompatible architecture — macOS: dlopen: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64') (macOS)mach-o file, but is a…Module 'x' not found (iOS build) — Xcode: Module 'firebase_core' not found — flutter build ios fails after adding a plugin (Flutter / Dart)Module 'x' not found …PhaseScriptExecution — Xcode: Command PhaseScriptExecution failed with a nonzero exit code (iOS)PhaseScriptExecutionRosetta 2 not installed — macOS: Rosetta is not installed — softwareupdate --install-rosetta failed / Install Rosetta to open Intel apps (macOS)Rosetta 2 not install…CocoaPods…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.