[iOS] error when use Pod install

I add Apollo to my Podfile as usual:

pod 'Apollo', '~> 1.0'

but I am receiving this error when it installs:

...
Installing Apollo (1.0.5)
[!] /bin/bash -c 
set -e
make clean build-cli-for-cocoapods
cp .build/release/apollo-ios-cli apollo-ios-cli
chmod +x apollo-ios-cli

swift package clean
swift build --product apollo-ios-cli -c release -Xswiftc -DCOCOAPODS
error: '1.0.5-b18b6': Invalid manifest
/Users/tulio.bazan/Library/Caches/CocoaPods/Pods/Release/Apollo/1.0.5-b18b6/Package.swift:4:8: error: no such module 'PackageDescription'
import PackageDescription
       ^
make: *** [build-cli-for-cocoapods] Error 1

My machine is a M1 MacBook Air,
Xcode 13.4.1
Cocoapods 1.10.2

if it helps…

Hi @Tulio_Bazan_da_Silva :wave: - it looks like there is some sort of conflict with the Swift package dependencies that are used to build the CLI during the pod install. I suggest trying swift package reset to reset and clean out the Swift package dependency cache. You might need to go into the /Users/tulio.bazan/Library/Caches/CocoaPods/Pods/Release/Apollo/1.0.5-b18b6 folder for that command to work.

I just figure it out, that my Xcode-select wasn’t in the correct path. To see the Xcode path, I run this code:

xcode-select --print-path

and after I change it to the correct path with:

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

Now it is working. Appreciate the help!

1 Like

Glad you got it working, hope the rest goes well.