Issues with CocoaPods

Daniel Kioko
TheCodr
Published in
2 min readNov 12, 2020

The most common problems I run into while using CocoaPods.

Photo by Ari He on Unsplash

Ever get annoyed when CocoaPods just doesn’t work as it should, and you don’t know why? I’ve been there. I’ve thought about manually downloading libraries, but this presents a challenge in updating them — I guess I’m better of dealing with errors.

I’ll go through some solutions of the most common errors I got while using CocoaPods.

No Such Module

This happens because a library is not installed properly or also becuase Xcode cannot find your library. Go to the Project ‘Build Settings’, navigate to Framework Search Paths to make sure your library is installed.

If you find it add the directory; “$(SRCROOT)” as a recursive.

Clean your build, delete your derived data from workspace settings. Then rebuild your application.

Another way to fix this is by re-intsalling you Pods. Simply run:

pod deintegrate
pod cache clean --all

Make sure to delete derived data, then run this:

pod install --repo-update

Re-build, and see that your project compiles successfully.

Compiled With Optimization

The message “app was compiled with optimization — stepping may behave oddly; variables may not be available,” might’ve popped up while running on release mode.

Here’s how to fix this:

Go to your project build settings, and search for ‘optimization.’ Under Apple Clang- Generation, set the optimization level to None[-OO]. Under Swift Compiler — Code Generation, set the optimization level to None[-OO].

Re-run your project, and it should work after this change.

Library Versions

Another common issue I get into is using a library version that might be either outdated or incompatible with what I’m trying to implement. As a result, I find myself going through documentation to see what features might’ve been added or dropped from a library.

A better way to see brief but vital information about a library you’ll use is by searching it on https://cocoapods.org.

Did I miss something? Let me know in the comments.

Happy Coding! 🌟

--

--