30

I am trying to set up CI on Xcode Server by creating a bot for an iOS app. I use CocoaPods so I'm using the script below to install the pods:

export LANG=en_US.UTF-8
#!/bin/bash
cd "$XCS_SOURCE_DIR/{PROJECTNAME}"
if [ -e "Pods" ]
then
/usr/local/bin/pod update
else
/usr/local/bin/pod install
fi

The current version of CocoaPods 0.39.0 is installed on the server. When I run "pod update" on the server everything is alright and the newest pods are installed.

Using FBAudienceNetwork (4.7.0)
Using FBSDKCoreKit (4.8.0)
Using Fabric (1.6.1)
Using FyberSDK (8.1.2)
Using Google-Mobile-Ads-SDK (7.6.0)
Using GoogleAnalytics (3.14.0)

When I use the script above however something strange happens.

Installing FBAudienceNetwork (4.1.0)
Installing FBSDKCoreKit (4.4.0)
Installing Fabric (1.2.8)
Installing FyberSDK (7.2.4)
Installing Google-Mobile-Ads-SDK (7.3.1)
Installing GoogleAnalytics (3.13.0)

Anyone has any idea why old versions are installed with the script? I use OS X Server 5.0.15 and Xcode 7.2.

The podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, "8.0"
use_frameworks!

target "{PROJECTNAME}" do
    inhibit_all_warnings!

    pod 'AFNetworking'
    pod 'Branch'
    pod 'SwrveSDK'
    pod 'RealmSwift'
    pod 'MZTimerLabel'
    pod 'pop' 
    pod 'Adjust'
    pod 'JSQMessagesViewController'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'GoogleAnalytics'
    pod 'FBSDKCoreKit'
    pod 'FyberSDK'
    pod 'AdColony'
    pod 'Google-Mobile-Ads-SDK'
    pod 'ChartboostSDK'
    pod 'FBAudienceNetwork'
    pod 'VungleSDK-iOS'
end

target "{PROJECTNAME}Tests" do
    inhibit_all_warnings!

    pod 'AFNetworking'
    pod 'Branch'
    pod 'SwrveSDK'
    pod 'RealmSwift'
    pod 'MZTimerLabel'
    pod 'pop'
    pod 'Adjust'
    pod 'JSQMessagesViewController'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'GoogleAnalytics'
    pod 'FBSDKCoreKit'
    pod 'FyberSDK'
    pod 'AdColony'
    pod 'Google-Mobile-Ads-SDK'
    pod 'ChartboostSDK'
    pod 'FBAudienceNetwork'
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
    end
end
youritrg
  • 651
  • 1
  • 6
  • 7

5 Answers5

35

I've got it working now! I didn't know about the _xcsbuildd user which does the builds. I found more about this here: https://honzadvorsky.com/articles/2015-08-17-17-30-xcode_server_tutorials_3_prebuild__postbuild_scripts/

So after logging in as this user I saw the same problem in the terminal on the server. Old versions of the pods were downloaded. The master repository of CocoaPods has some error, so I did

rm -rf ~/.cocoapods/repos/master

Then I ran

pod setup --verbose

And the master repository with the Cocoapods specs was installed again. Now it works!

youritrg
  • 651
  • 1
  • 6
  • 7
  • 2
    Thanks, this helped me today. As a note for others it took ages before the cloning actually started, so first I thought it was not working. But I left it alone and it started and all was good. – Benedicte Raae Dec 28 '16 at 09:36
8

For those of you encountering this issue with newer libraries like:

  • Facebook login
  • 'FBSDKLoginKit'
  • 'FBSDKShareKit'
  • 'FBSDKCoreKit'

you need to update your cocoapods to the latest version ( currently 1.2)

I did the following which worked: (Warning Cocoapods seems to sit idling for ages but I guess its doing something. ) Follow the first two steps from @youritrg above in terminal:

rm -rf ~/.cocoapods/repos/master
pod setup --verbose 

You should now have an refreshed installation. I then updated by doing:

sudo gem install cocoapods

After installation the Facebook Cocoapods installed perfectly.

UKDataGeek
  • 6,338
  • 9
  • 46
  • 63
5

Running pod repo update fixed this error for me

mwanjajoel
  • 325
  • 3
  • 6
4

For me uninstalling everything then removing the master repo worked

gem list --local | grep cocoapods
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
sudo gem uninstall cocoapods-downloader 
sudo gem uninstall cocoapods-plugins
sudo gem uninstall cocoapods-search
sudo gem uninstall cocoapods-stats
sudo gem uninstall cocoapods-trunk
sudo gem uninstall cocoapods-try

then

rm -rf ~/.cocoapods/repos/master
sudo gem install cocoapods

then

pod setup --verbose
SpaceDust__
  • 4,844
  • 4
  • 43
  • 82
1

Sorry for digging up an old thread, but I had a similar problem with Firebase/Admob not updating. I got the same error as others have mentioned above. I tried everything mentioned above, but for me, the only way I could get the pods to update correctly was to comment out the line

use_frameworks!

I know that this should be included as I am using Swift, but it seems to work fine now. If anyone has any thoughts on why, I would love to know what is going on!

Iain Coleman
  • 166
  • 1
  • 13