CocoaPods installation failure when building for iOS

Posting on behalf of another user:

In case anyone stumbled on this problem from trying to make an iOS build on an M1 (Apple Silicon) macOS after integrating LevelPlay (IronSource, Ads Mediation)… I was able to resolve the problem by doing the below steps:

  1. Open terminal
  2. Type: gem list
  3. In my case, the list that resulted had all this:
cocoapods (1.10.2)
cocoapods-core (1.10.2)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
cocoapods-try (1.2.0)
  1. From that list, uninstall everything that references ‘cocoapods’. Do this by typing the following for each ‘cocoapods’ reference you see: sudo gem uninstall cocoapods-core
  2. Install homebrew.
  3. Update homebrew: brew upgrade
  4. Using homebrew, install Ruby brew install rbenv ruby-build
  5. Update ruby: rbenv install 3.2.0
  6. Set the new ruby version to global: rbenv global 3.2.0
  7. Restart your computer.
  8. Then reinstall cocoapods by entering: sudo arch -arm64 gem install -n /usr/local/bin cocoapods -v 1.10.2
  9. Finish setup by typing pod setup
  10. Restart the Unity Editor
8 Likes

To install homebrew on M1 macs, I followed this guide here: Mac Homebrew · Short Complete Guide · 2024

  • important: After running the install command, Homebrew will run installation and will end by showing you a set of instructions titled “Next steps”. Make sure you finish the installation by doing what those instructions at the end tell you to do.

It’s works for me! thanks a lot!

1 Like

Worked for me on my M1 Mac.

1 Like

I can confirm this looks like it is working in 2022.3. Also updating the pods file to 1.13.0 did not work, it seems like it has to be 1.10.2

However when I go to build my app in XCode, it fails and says if cant find the libraries. Im not sure is thi is a Facebook issue or something in my setup.

I get an error when the app loads:

dyld[83827]: Library not loaded: @rpath/FBAEMKit.framework/FBAEMKit
  Referenced from: <81B561ED-69F2-3E2D-BC07-B613266843EC> /private/var/containers/Bundle/Application/E9E3A4CE-3591-4B11-86B6-9A92A0FC2A18/Test.app/Test
  Reason: tried: '/private/var/containers/Bundle/Application/E9E3A4CE-3591-4B11-86B6-9A92A0FC2A18/Test.app/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file), '/private/var/containers/Bundle/Application/E9E3A4CE-3591-4B11-86B6-9A92A0FC2A18/Test.app/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file), '/private/var/containers/Bundle/Application/E9E3A4CE-3591-4B11-86B6-9A92A0FC2A18/Test.app/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file), '/private/var/containers/Bundle/Application/E9E3A4CE-3591-4B11-86B6-9A92A0FC2A18/Test.app/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file), '/private/var/containers/Bundle/Application/E9E3A4CE-3591-4B11-86B6-9A92A0FC2A18/Test.app/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file), '/private/var/containers/Bundle/Application/E9E3A4CE-3591-4B11-86B6-9A92A0FC2A18/Test.app/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file), '/System/Library/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file, not in dyld cache)
(lldb)

To fix this i have to run pod update in the built folder.

Are there any plans to improve this integration?

1 Like

This was the only solution that did the trick for me. Thanks for sharing. I posted this into an issue at the Google Resolver, because I think it needs a more elegant solution than this workaround:

https://github.com/googlesamples/unity-jar-resolver/issues/654

2 Likes

I have the same situation. I have to run pod update in the built folder.
Unity 2022.3.12f1, macOS 13.5, Xcode 14.3.1 (15.0.1 doesn’t build, as discussed elsewhere), building for iOS

saved my day thank you!

I unchecked a box to get a successful build:

My error:
iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.

After the failure, “pod repo update” was executed and succeeded. “pod install” was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: CocoaPods Guides - Troubleshooting for potential solutions.

1 Like

I’ve encountered CocoaPods issue not being installed - it’s blocking any build of the game now.

  • tried to uninstall all cocoapods and re-install - failed
  • cocoapods fails due to mismatch of ruby versions - but am unsure about changing ruby setup.
  • tried unchecking the shell tickbox in unity IOs resolver but that failed.
    Has anyone else found a solution recently?

For those experiencing issues with CocoaPods, if you don’t mind using the ‘SUDO’ command, this solution might work:

sudo gem install -n /usr/local/bin cocoapods -v 1.8.4

The latest versions of CocoaPods are incompatible.

Additionally, uncheck the following two options found in Asset > External Dependency Manager > iOS Resolver > Settings:

• Use Shell to Execute CocoaPods Tool
• Auto Install CocoaPods Tools in Editor

Have a great day! :sun_with_face:

1 Like

Great solution, works on iOS 2022.3.36f