cocoa pods install on iOS project not working

Looking at the error logs:

checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot 
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'

There is the same kind of error on this link.

You either need to do a xcode-select, or at least in XCode, Preferences/Locations/Command Line Tools, I guess.


Just execute the below command and you should be good to go:

sudo xcode-select --switch /Applications/Xcode.app

Credits


Command sudo xcode-select --switch /Applications/Xcode.app

Response xcode-select: error: invalid developer directory '/Applications/Xcode.app'

Command xcrun --sdk iphoneos --show-sdk-path

Response xcrun: error: SDK "iphoneos" cannot be located xcrun: error: SDK "iphoneos" cannot be located xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'

Command to get Xcode path Xcode-select --print-path

Response

/Library/Developer/CommandLineTools

To Fix this

XCode->Preferences->Locations->Command Line Tools and select the xcode

This worked for me