r/reactnative • u/ConfidentWafer5228 • 12d ago
Help Installing CocoPods... takes forever
EDIT: SOLVED , Thanks to u/kokerali and u/jiunkdev
As the title states, whenever i need to use expo's CNG ( i.e. when i change package.json, bring native deps or change app.json) i need to run "npx expo prebuild --clean" according to the docs, but the build process is simply random, most of the times the cocoapods will never finish, sometimes it does somehow.
I did search for this, found an old reddit post with instructions to pod repo remove trunk but that also didnt help ( it works sometimes randomly)
Please help
2
Upvotes
3
u/kokerali 12d ago
Since it only hangs some of the time, I'd first find out which step it's stuck on. Run npx expo prebuild --clean --no-install, then cd ios && pod install --verbose. The verbose output shows the exact pod or download it's waiting on, which tells you a lot more than retrying.
A common one is hermes-engine, which downloads a fairly large prebuilt tarball during pod install, so a slow or flaky connection looks like a hang right there. If it's stuck on a git clone of some dependency instead, that also points at the network rather than the specs repo, and removing trunk wouldn't help with either.
Also, --clean deletes the ios folder every time, so every run is a full pod install from scratch. If you only added a JS package you don't need prebuild at all, and for native changes plain npx expo prebuild without --clean is often enough and a lot faster.
0
u/[deleted] 12d ago
[removed] — view removed comment