Cocoapod CI on travis can't install dependencies - ios

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

Related

Travis-ci gets stuck in pods installation

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.

Flutter:error running pod install after upgrading to flutter facebook login v3.00

I just change the flutter facebook plugin from 2.0.0 to 3.0.0 and now I am getting POD error when I execute flutter build.
Need some help how debug and fix this issue
MY POD file snippet
platform :ios, '9.0'
flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
pod 'FBSDKCoreKit', '4.39.1'
pod 'FBSDKLoginKit', '4.39.1'
--- This error message ----
This is the error dump
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
M Flutter
- FBSDKCoreKit
- FBSDKLoginKit
- file_picker
- firebase_analytics
- firebase_auth
- firebase_core
- firebase_crashlytics
- firebase_dynamic_links
- firebase_messaging
- firebase_remote_config
- flutter_facebook_login
- flutter_statusbarcolor
- google_sign_in
- keyboard_visibility
- location
- package_info
- path_provider
- share
- shared_preferences
- url_launcher
Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "FBSDKLoginKit":
In snapshot (Podfile.lock):
FBSDKLoginKit (= 4.39.1)
In Podfile:
FBSDKLoginKit (= 4.39.1)
flutter_facebook_login (from `.symlinks/plugins/flutter_facebook_login/ios`) was resolved to 0.0.1, which depends on
FBSDKLoginKit (~> 5.5)
Specs satisfying the `FBSDKLoginKit (= 4.39.1), FBSDKLoginKit (= 4.39.1), FBSDKLoginKit (~> 5.5)` dependency were found, but
they required a higher minimum deployment target.
/usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `load'
/usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `<main>'
Error running pod install
I have clear the cache but I still get the error..
Delete
Podfile.lock
Then run
pod install.
It worked for me.
Am using
flutter_facebook_login
You can try to run the following in the ios directory:
$ pod repo update
$ pod install
You might need to delete the Podfile.lock file first (i'm not sure it helps but it's what i did).
to fix used two commands:
- pod repo update
- pod update FBSDKCoreKit
——————————————————————
after pod repo update :
MacRoberto-8:Nixtelecom robertofonseca$ cd ios
MacRoberto-8:ios robertofonseca$ pod update FBSDKCoreKit
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing BoringSSL-GRPC (0.0.3)
Installing FBSDKCoreKit (5.6.0)
Installing FBSDKLoginKit (5.6.0)
Installing firebase_core (0.0.1)
.
.
.
.
Generating Pods project
Integrating client project
Pod installation complete! There are 14 dependencies from the Podfile and 37 total pods installed.
MacRoberto-8:Nixtelecom robertofonseca$ flutter build ios --release
.
.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===

Xcode linker error and pod install indicates only 3 dependencies out of 4

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).

Ionic 3 - xcode error with cocoapods

I try to build an ionic 3 app with push notification and I have some problem with iOS deployment.
I have this 3 error in xcode :
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I have try a lot of solution I found on internet :
use command "pod install", "pod update"
delete and install CocoaPods
update CocoaPods
Delete "Pods" folder, "Podfile.lock" and "Podfile" and run "pod install" command.
Remove libPods-myApp.a from Link Binary From Librairies.
But nothing is effective...
I really don't know what I have to do.
My Podfile :
# DO NOT MODIFY -- auto-generated by Apache Cordova
platform :ios, '8.0'
target 'MyProject' do
project 'MyProject.xcodeproj'
pod 'GoogleCloudMessaging', '~> 1.2.0'
pod 'GGLInstanceID', '~> 1.2.1'
end
My Podfile.lock :
PODS:
- GGLInstanceID (1.2.1)
- GoogleCloudMessaging (1.2.0):
- GoogleInterchangeUtilities (~> 1.0)
- GoogleIPhoneUtilities (~> 1.0)
- GoogleSymbolUtilities (~> 1.0)
- GoogleInterchangeUtilities (1.2.2):
- GoogleSymbolUtilities (~> 1.1)
- GoogleIPhoneUtilities (1.2.1):
- GoogleSymbolUtilities (~> 1.0)
- GoogleUtilities (~> 1.0)
- GoogleSymbolUtilities (1.1.2)
- GoogleUtilities (1.3.2):
- GoogleSymbolUtilities (~> 1.1)
DEPENDENCIES:
- GGLInstanceID (~> 1.2.1)
- GoogleCloudMessaging (~> 1.2.0)
SPEC CHECKSUMS:
GGLInstanceID: 4a317044f744281b82cd03015f379899f277cad3
GoogleCloudMessaging: f37ea14dd0f41d4d889c10b5559dd35bbfd9ac26
GoogleInterchangeUtilities: d5bc4d88d5b661ab72f9d70c58d02ca8c27ad1f7
GoogleIPhoneUtilities: 63f25e93a3ddcb66884d182aab3a660d98f1479b
GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96
GoogleUtilities: 8bbc733218aad26306f9d4a253823986110e3358
PODFILE CHECKSUM: 0ff66d442dc6f28bf0fbc7a6b12af811ecc9a43c
COCOAPODS: 1.2.1
UPDATE
My [CP] Check Pods Manifest.lock :
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
exit 1
fi
I really need help please. :(
UPDATE
I have modify my [CP] Check Pods Manifest.lock to this :
diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
exit 1
fi
My tree errors are disapear but I have this new error :
Module 'FirebaseInstanceID' not found
I don't know why. I tried to run pod install but no difference.
Try
pod repo update
pod install
Open up terminal and run
pod deintegrate
This will remove all connections of pods and your project.
Then you can run
pod install
Please check the path of the xcode project
project 'MyProject.xcodeproj'
Does your podfile and the 'MyProject.xcodeproj' are located on the same directory ? If so you can try removing the ligne above from your podfile

Travis CI fails iOS Build

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.

Resources