I'm trying to configure Travis-CI on my GitHub repo using the following configurations
.travis.yml
language: objective-c
osx_image: xcode11.2
xcode_workspace: NinchatSDK.xcworkspace
xcode_scheme: NinchatSDK
xcode_destination: platform=iOS Simulator,OS=13.2,name=iPhone 8
before_install:
- git submodule update --init --recursive
- brew install go
- go get -u golang.org/x/mobile/cmd/gomobile
- export PATH=$PATH:~/go/bin
- gomobile init
- ./update-go-framework.sh
- gem install cocoapods
- gem update concurrent-ruby
- pod setup
script:
- xcodebuild -workspace NinchatSDK.xcworkspace -scheme NinchatSDK -configuration "Release"
Podfile:
platform :ios, '9.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/somia/ninchat-podspecs.git'
def all_pods
pod 'AFNetworking', '~> 3.0'
pod 'NinchatLowLevelClient', '~> 0'
pod 'GoogleWebRTC', '~> 1.1'
#pod 'NinchatLowLevelClient', :path => '.'
end
target 'NinchatSDK' do
all_pods
end
target 'NinchatSDKTests' do
all_pods
end
Problem
The build server gets stuck in cocoapods installation and returns the timeout error after some time:
Cloning spec repo 'cocoapods' from 'https://github.com/CocoaPods/Specs.git'
No output has been received in the last 10m0s, this potentially indicates ....
Use source 'https://cdn.cocoapods.org/' instead of 'https://github.com/CocoaPods/Specs.git'.
With recent versions of CocoaPods it should be way faster and also more reliable.
Related
I am trying to build an iOS(swift) project with Pods, with Travis CI but I am getting the the following error.
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (1.2.1.beta.1) is higher than the version of the current executable (1.2.0). Incompatibility issues may arise.
Pre-downloading: `SwiftValidator` from `https://github.com/jpotts18/SwiftValidator.git`, commit `2a6c23ad9efd76127f6109445515cb9780e5ad92`
[!] Unable to satisfy the following requirements:
- `Marshal (= 1.2.4)` required by `Podfile`
- `Marshal (= 1.2.4)` required by `Podfile.lock`
None of your spec sources contain a spec satisfying the dependency: `Marshal (= 1.2.4)`.
You have either:
* out-of-date source repos which you can update with `pod repo update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
The command "eval pod install " failed 3 times.
The command "pod install" failed and exited with 1 during .
Here is my .travis.yml file:
language: swift
osx_image: xcode8.3
branches:
only:
- develop
- master
env:
- LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8
before_install:
- rvm install ruby-2.2.2
- gem install cocoapods
- gem install xcpretty -N
- brew update
- brew install swiftlint || true
script:
- set -o pipefail
- xcodebuild -workspace Invision.xcworkspace -scheme Invision -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c
- swiftlint
Reading through the log I can see that there is something wrong with the Pods. So here is my Podfile
platform :ios, '8.0'
target 'Invision' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Invision
pod 'ZLSwipeableViewSwift'
pod 'Moya'
pod 'Marshal', '1.2.4'
pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :branch => 'master'
pod 'Log'
target 'InvisionTests' do
inherit! :search_paths
# Pods for testing
end
target 'InvisionUITests' do
inherit! :search_paths
# Pods for testing
end
end
I have also read about how to solve the problem and some of the suggestions were:
pod update Marashl - didn't work
Any ideas of how to solve this problem ?
It seems the code you pushed using CocoaPods 1.2.1.beta.1 but Travis-CI supports 1.2.0. gem install cocoapods installs the stable version of CocoaPods try installing beta version
xcode8.3 isn't supported yet hence you might be routed to the default image which is xcode7.3. See https://docs.travis-ci.com/user/osx-ci-environment/#OS-X-Version.
Can you try with osx_image: xcode8.2?
Update 2017-05-15: xcode8.3 is now supported: https://blog.travis-ci.com/2017-04-19-xcode-832-is-here.
Recently upgraded to XCode 8.1 trying to install Alamofire pod for a new project. Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'app' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for app
pod 'Alamofire',
:git => 'https://github.com/Alamofire/Alamofire.git',
:branch => 'swift3'
end
And my terminal responds:
image
so what can I do?
--Update--
also tried pod 'Alamofire', '~> 4.0'
here is the result
I did the pod repo update it doesn't do anything at all
Edit your podFile as below and just install the pods using pod install --verbose command if still error exists then update your repo with pod repo update then try again.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'app' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for app
pod 'Alamofire'
end
As per the discussion here,
You need to use
pod 'Alamofire', '~> 4.0'
In your pod file
I faced the same problem when i updated the mac os from el capitan to sierra and installed new version of Xcode.
I updated the cocoapod and still, was facing the same problem.
I found a solution by completely removing cocoapod from root directory and installing it again.
To remove the cocoapod completly use this in terminal
$ sudo rm -fr ~/Library/Caches/CocoaPods/
$ sudo rm -fr ~/.cocoapods/repos/master/
and then install the cocoapod again
$ gem install cocoapods
I have an app that holds two libray installed with cocoapods, Braintree and GoogleAnalytics. What i wanna do is remove Braintree from my project. This is my Podfile in the root of my project:
# Uncomment this line to define a global platform for your project
# platform :ios, '7.0'
target 'MyApp' do
pod 'Braintree'
pod 'Google/Analytics'
end
target 'MyAppTests' do
pod 'Braintree'
end
I have tried this solution , but maybe i do something wrong. My steps are: Open terminal -> go to root directory of my project -> $ pod update. This returns to me "pod update command not found". What's wrong or what are the correct steps to remove the Braintree library?
Update your pod file in following manner
# Uncomment this line to define a global platform for your project
# platform :ios, '7.0'
target 'MyApp' do
#pod 'Braintree'
pod 'Google/Analytics'
end
target 'MyAppTests' do
#pod 'Braintree'
end
Above file, I have commented the Braintree library. Now you need to execute pod update or pod install.
As you are facing error of "pod update command not found", you should first install the cocoapods in your mac as guided in https://stackoverflow.com/a/37939140/1030951 answer.
Try running this command
sudo gem intall cocoa pods
And then try pod update again
I am trying to install Pod using abstract_target to share common Pods for multiple target. I am follow CocoaPods to install Pods. But it generates following error.
[!] Invalid `Podfile` file: undefined method `abstract_target' for #<Pod::Podfile:0x007fcd7380d098>. Updating CocoaPods might fix the issue.
# from /Users/Sagar/Desktop/CocoaPodsMultipleTarget/Podfile:5
# -------------------------------------------
#
> abstract_target "Networking" do
#
# -------------------------------------------
I updated my CocoaPods and my current version is :
/Users/Sagar/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/cocoapods-1.0.0.beta.2/lib/cocoapods.rb
Below is my Podfile.
# Uncomment this line if you're using Swift
use_frameworks!
abstract_target 'Networking' do
pod 'AlamoFire'
target 'CocoaPodsMultipleTarget' do
platform :ios, '9.0'
pod 'IQKeyboardManagerSwift'
end
target 'MyWatchDemo Extension' do
platform :watchos, '2.0'
end
end
Is there any thing wrong with my Podfile ?
Any help or suggestion should be appreciated.
Are you sure your version of CocoaPods is 1.0 and not 0.39.0? Using abstract_target only works on 1.0 and above. In your terminal...
Check version:
$ pod --version
Update for the pre-release version:
$ [sudo] gem install cocoapods --pre
For reference: https://guides.cocoapods.org/using/getting-started.html
I am currently getting the following error when running pod install:
[!] Invalid `Podfile` file: undefined method `source' for #<Pod::Podfile:0x007fcf91b8c7a8>. Updating CocoaPods might fix the issue.
# from /Users/preston/Work/Test/Podfile:1
# -------------------------------------------
> source 'https://github.com/CocoaPods/Specs.git'
# platform :ios, '8.0'
# -------------------------------------------
I have tried the following:
pod repo remove master; pod setup
rm -rf ~/.cocoapods; pod setup
sudo gem uninstall cocoapods; sudo gem install cocoapods
After running the last bullet point I ran pod setup and got the following:
Setting up CocoaPods master repo
Already up-to-date.
CocoaPods 0.36.0 is available.
To update use: [sudo] gem install cocoapods
Setup completed (read-only access)
Which is confusing because I just updated.
Evening after running all of these commands I am still getting the above error. Does anyone know what might be going wrong?
Edit:
Here is my Podfile. However everything worked on another computer but not on mine:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!