Member-only story
Title: ❌ Solving the “Codegen did not run properly” Error in React Native Projects

If you’ve been working with React Native, you may have encountered the frustrating error:
error: Codegen did not run properly in your project. Please reinstall cocoapods with bundle exec pod install.
This error can pop up unexpectedly, especially after clearing caches or updating dependencies. In this post, I’ll walk you through the steps I took to resolve this issue.
How I Encountered the Problem
After cleaning up my project cache, I ran into this error when trying to build my iOS project. The suggestion was straightforward: run bundle exec pod install
. So I followed the instructions and ran:
bundle exec pod install
But instead of solving the problem, I got another error:
Could not locate Gemfile or .bundle/ directory
This was a bit confusing. Normally, bundle exec pod install
works well if you have a Gemfile set up to manage CocoaPods. But in my case, there was no Gemfile, and this error left me searching for answers.