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.
Related
[!] CocoaPods could not find compatible versions for pod "Flipper-Glog":
In Podfile:
Flipper-Glog (= 0.5.0.4)
None of your spec sources contain a spec satisfying the dependency: Flipper-Glog (= 0.5.0.4).
You have either:
out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
mistyped the name or version.
not added the source repo that hosts the Podspec to your Podfile.
Disable everything related to flipper in Podfile and then cd ios && pod install
# use_flipper!()
Worked after using this command:
pod install --repo-update
If you are building from a fresh Reach Native Project, there should be no need to edit any files in the project to get it to run.
Try the solutions here:
React native ios - error when running pod install (installing Flipper-Glog)
I encountered this problem after deleting all my iOS caches and setting some Virtual Env. Opening Xcode and simulator once then try "pod install" should work.
Remove or comment this line from your ios/Podfile in react native.
# use_flipper!()
For M1 chip Mac, run
"arch -x86_64 pod install"
solved it.
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.
This is a cocoapod I created with pod lib create according to the cocoapods guide: https://guides.cocoapods.org/making/using-pod-lib-create.html. The directory stucture and files and the example project were generated for me.
My .travis.yml looks like this:
# references:
# * https://www.objc.io/issues/6-build-tools/travis-ci/
# * https://github.com/supermarin/xcpretty#usage
osx_image: xcode10.3
language: objective-c
# cache: cocoapods
xcode_workspace: Example/MUXSDKImaListener.xcworkspace
xcode_scheme: MUXSDKImaListener-Example
podfile: Example/Podfile
xcode_sdk: iphonesimulator9.3
before_install:
- gem install cocoapods # Since Travis is not always on latest version
- pod repo update
- pod install --project-directory=Example
script:
- set -o pipefail && xctool test -enableCodeCoverage YES -workspace Example/MUXSDKImaListener.xcworkspace -scheme MUXSDKImaListener-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
When travis tries to build these tests, it runs into an error when installing Cocoapods. This output is a bit confusing because it seems to say it needs Mux-Stats-AVPlayer 1.0.1, but then it stays it can't find that version.
That version exists: https://cocoapods.org/pods/Mux-Stats-AVPlayer
$ bundle --version
Bundler version 2.0.2
announce
$ xcodebuild -version -sdk
$ pod --version
1.7.5
before_install.1
2.77s$ gem install cocoapods
2.76s$ pod install --repo-update --project-directory=Example
Updating local specs repositories
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Mux-Stats-AVPlayer":
In snapshot (Podfile.lock):
Mux-Stats-AVPlayer (= 1.0.1, ~> 1.0.1)
In Podfile:
Mux-Stats-Google-IMA (from `../`) was resolved to 0.3.0, which depends on
Mux-Stats-AVPlayer (~> 1.0.1)
None of your spec sources contain a spec satisfying the dependencies: `Mux-Stats-AVPlayer (= 1.0.1, ~> 1.0.1), Mux-Stats-AVPlayer (~> 1.0.1)`.
You have either:
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
[!] Automatically assigning platform `iOS` with version `9.3` on target `MUXSDKImaListener_Tests` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
The command "pod install --repo-update --project-directory=Example" failed and exited with 31 during .
Your build has been stopped.
The full build is here:
https://travis-ci.org/muxinc/mux-stats-google-ima/builds/588638291
It seems like I'm missing something obvious in this .travis.yml config file.
Podfile for the example project
use_frameworks!
target 'MUXSDKImaListener_Tests' do
pod 'Mux-Stats-Google-IMA', :path => '../'
pod 'Specta'
pod 'Expecta'
end
Podfile.lock for Example project
PODS:
- Expecta (1.0.6)
- GoogleAds-IMA-iOS-SDK (3.10.1)
- Mux-Stats-AVPlayer (1.0.1):
- Mux-Stats-Core (~> 2.0.0)
- Mux-Stats-Core (2.0.12)
- Mux-Stats-Google-IMA (0.3.0):
- GoogleAds-IMA-iOS-SDK (~> 3.9)
- Mux-Stats-AVPlayer (~> 1.0.1)
- Specta (1.0.7)
DEPENDENCIES:
- Expecta
- Mux-Stats-Google-IMA (from `../`)
- Specta
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Expecta
- GoogleAds-IMA-iOS-SDK
- Mux-Stats-AVPlayer
- Mux-Stats-Core
- Specta
EXTERNAL SOURCES:
Mux-Stats-Google-IMA:
:path: "../"
SPEC CHECKSUMS:
Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5
GoogleAds-IMA-iOS-SDK: 0e37ab83b22075ad631a70dcba9528cb246c92bf
Mux-Stats-AVPlayer: e8ab70f9e67ac54958ac6ee87f479e3c0486baf5
Mux-Stats-Core: 73e692799571459722526ff4a721b6872da5c776
Mux-Stats-Google-IMA: 6ef4042dc3a1052ed55edfcc35a55b8106d2a4a3
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
PODFILE CHECKSUM: 95e48c48a4efb20f1822c750f01f9c105d46475a
COCOAPODS: 1.7.5
Mux-Stats-Google-IMA.podspec file for the pod:
#
# Be sure to run `pod lib lint MUXSDKImaListener.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'Mux-Stats-Google-IMA'
s.version = '0.3.0'
s.summary = 'Mux-Stats-Google-IMA is for tracking performance analytics and QoS monitoring for video with mux.com.'
s.description = <<-DESC
The Mux Stats Google IMA is designed to be used with Mux-Stats-AVPlayer and GoogleAds-IMA-iOS-SDK to track performance analytics and QoS monitoring for video.
DESC
s.homepage = 'https://mux.com'
s.social_media_url = 'https://twitter.com/muxhq'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.author = { 'Mux' => 'ios-sdk#mux.com' }
s.source = { :git => 'https://github.com/muxinc/mux-sdk-ima-listener.git', :tag => "v#{s.version}" }
s.ios.deployment_target = '9.0'
s.source_files = 'MUXSDKImaListener/Classes/**/*'
s.dependency 'Mux-Stats-AVPlayer', '~> 1.0.1'
s.dependency 'GoogleAds-IMA-iOS-SDK', '~> 3.9'
end
I don't know why the pod install in my example was failing, but reverting back to the auto-generated .travis.yml fixed it. The only thing I had to modify was adding a the instructions under before_install:
pod setup without this line - the pod lib lint failed with a specific error:
ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for Mux-Stats-AVPlayer (~> 1.0.0) depended upon by Mux-Stats-Google-IMA) during validation.
gem update concurrent-ruby without this line - the pod lib lint failed with a different error:
ERROR | [iOS] unknown: Encountered an unknown error (uninitialized constant Concurrent::Promises) during validation.
So, this is what my .travis.yml looks like now and it runs the tests and runs pod lib lint.
# references:
# * https://www.objc.io/issues/6-build-tools/travis-ci/
# * https://github.com/supermarin/xcpretty#usage
osx_image: xcode7.3
language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
before_install:
- gem install cocoapods # Since Travis is not always on latest version
# Avoid error: Encountered an unknown error (uninitialized constant Concurrent::Promises) during validation
# https://github.com/CocoaPods/CocoaPods/issues/8948
- gem update concurrent-ruby
- pod setup
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MUXSDKImaListener.xcworkspace -scheme MUXSDKImaListener-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
In Xcode 10.1, I'm getting a linker error surrounding SwiftCharts. This is after I began running 10.2, and needed to revert to 10.1, because of an Xcode bug. I shut down Xcode and cleaned the pods with the following:
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install
which resulted in no DerivedData. The output of the install was the following:
pod install
Analyzing dependencies
Downloading dependencies
Installing Realm (3.14.1)
Installing RealmSwift (3.14.1)
Installing SwiftCharts (0.6.5)
Installing SwiftGraph (2.0.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 4 total pods installed.
At this point, there is no data in DerivedData.
When I startup Xcode, I get a linker error:
: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/Realm'
: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/RealmSwift'
: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/SwiftCharts'
: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/SwiftGraph'
: Linker command failed with exit code 1 (use -v to see invocation)
In the editor:
ld: framework not found SwiftCharts
Underneath DerivedData, in the folder Debug-iphonesimulator, I'm not seeing any frameworks that the warnings are indicating should be there. Why are the framework directories missing, and why is SwiftCharts installing but not available to the linker?
Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '12.1'
target 'ProjectCoreData' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'SwiftCharts', '~> 0.6.3'
pod 'SwiftGraph'
pod 'OverlayContainer'
pod 'RealmSwift'
# Pods for ProjectCoreData
target 'ProjectCoreDataTests' do
inherit! :search_paths
# Pods for testing
end
target 'ProjectCoreDataUITests' do
inherit! :search_paths
# Pods for testing
end
"Podfile" 24L, 549C
Podfile.lock:
PODS:
- OverlayContainer (2.0.0)
- Realm (3.14.1):
- Realm/Headers (= 3.14.1)
- Realm/Headers (3.14.1)
- RealmSwift (3.14.1):
- Realm (= 3.14.1)
- SwiftCharts (0.6.5)
- SwiftGraph (3.0.0)
DEPENDENCIES:
- OverlayContainer
- RealmSwift
- SwiftCharts (~> 0.6.3)
- SwiftGraph
I think it's because SwiftCharts (0.6.5) is built for swift 5.0 with Xcode 10.2, so it's not compatible with Xcode 10.1, just use older version of SwiftCharts (0.6.3 or older).
I want to install the GoogleMap SDK for iOS in my project. But when I installed with pod install it got an error.
[!] Unable to find a specification for `GoogleMaps`
pod repo remove master ; pod setup doesn't help. pod repo update --verbose
Updating spec repo `.git`
$ /usr/bin/git -C /Users/admin/.cocoapods/repos/.git fetch origin
From https://github.com/CocoaPods/Specs
42723a4..830f47f master -> origin/master
$ /usr/bin/git -C /Users/admin/.cocoapods/repos/.git rev-parse --abbrev-ref
HEAD
HEAD
$ /usr/bin/git -C /Users/admin/.cocoapods/repos/.git reset --hard origin/HEAD
fatal: ambiguous argument 'origin/HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[!] CocoaPods was not able to update the `.git` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`
My podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Interests' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Interests
pod 'GoogleMaps'
target 'InterestsTests' do
inherit! :search_paths
# Pods for testing
end
target 'InterestsUITests' do
inherit! :search_paths
# Pods for testing
end
end
You need to specify the Specs repo at the top of the Podfile as follows:
source 'https://github.com/CocoaPods/Specs.git'
I can see this is the case because of the error you have listed:
Updating spec repo `.git`
[!] CocoaPods was not able to update the `.git` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`
Using this approach of reinstalling via brew which fixed the issue.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
sudo gem uninstall cocoapods
brew install cocoapods --with-brewed-curl --with-brewed-openssl