Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

CocoaPods is installed but broken (error  bitbucket-pipelines.yml)

Alexander Shilenkov May 20, 2024

Warning: CocoaPods is installed but broken. Skipping pod install. You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. CocoaPods not installed or not in valid state.


My bitbucket-pipelines.yml:

- step: &ios-build
name: Build and upload apps to TestFlight
runs-on:
- self.hosted
- macos
caches:
- dartpubcache
script:
- gem uninstall cocoapods
- gem install cocoapods
- pod --allow-root install
- pod --allow-root repo update
- /bin/bash scripts/utils.sh -i -p "${Platform:-ios}" release ${Flavour:-all} ${Environment:-all}

Tell me how to solve the problem?

 

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2024

Hello @Alexander Shilenkov ,

and welcome to the Community!

Based on the YAML configuration you have provided, it appears that you are utilizing MacOS self-hosted runners.

These runners operate within a shell session directly on your Mac, granting them complete access to your Mac environment and all installed components. Essentially, the runner will execute commands in a manner similar to opening a terminal session on your Mac and entering commands manually.

This means that any executable installed on your Mac will already be available to the runner, so you will not need to install it again as part of your pipeline scripts.

That being said, the error message seems to come from some conflict in the pipeline trying to reinstall a different version of CocoaPods, which is already installed on your Mac, causing that conflict.

I suggest that you first install and test CocoaPods on your Mac directly by opening a terminal session and executing the commands manually. Once you get it working, you can then test your build again, but now remove the install and uninstall commands from the build as they are not required since CocoaPods is already installed in the runner's host.

Hope that helps! Should you have any questions, feel free to ask.

Thank you, @Alexander Shilenkov !

Patrik S

Alexander Shilenkov May 22, 2024

Thanks, I removed the commands - gem uninstall cocoapods
- gem install cocoapods
- pod --allow-root install
- pod --allow-root repo update

and deleted

runs-on:
self.hosted
macos
and it works for now, it’s strange that before that asked for installation CocoaPods

While it works

My bitbucket-pipelines.yml:

step&ios-build
nameBuild and upload apps to TestFlight
caches:
dartpubcache
script:
/bin/bash scripts/utils.sh -i -p "${Platform:-ios}" release ${Flavour:-all} ${Environment:-all}





Like Patrik S likes this
Alexander Shilenkov May 23, 2024

Can I specify the path to the ios directory to run pod install there?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events