Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods - Found multiple specifications warning

Tags:

cocoapods

On pod install, I am getting warning like Found multiple specifications for "<Pod Name>"

It means that I have multiple Podspecs in this directory ~/cocoapods/repo

Example Podfile:

source '<Private Podspec>'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

target 'SDKDemo' do
  use_frameworks!    
  pod '<Pod Name>'
end 

My question is that

  1. which Podspec will be used when installing pod.
  2. If Podspec is taken from <Private Podspec>, How it will work in this case
source 'https://github.com/CocoaPods/Specs.git'
source '<Private Podspec>'

I came to conclusion like order of source will affect deciding the Podspec. But I want to clarify this.

like image 901
Vigneshkumar G Avatar asked Dec 18 '22 18:12

Vigneshkumar G


2 Answers

On my side, that approach (changing the order of the sources) never worked.

I needed to specify the source for my private pod in order to make it work. The reason is that my private pod registered in my private specs repo has the same name than another one registered in the public cocoapods specs repo.

i.e.:

source 'https://github.com/CocoaPods/Specs.git' # public cocoapods specs repo
source 'https://github.com/{:user}/specs.git' # my private specs repo

platform :ios, '11.0'

target 'MyAppTarget' do
  use_frameworks!
  # any other public pod ...
  pod 'PrivatePod', :source => 'https://github.com/{:user}/specs.git'
end

This is what solved my issue.

like image 73
eMdOS Avatar answered Dec 20 '22 06:12

eMdOS


I had both source 'https://cdn.cocoapods.org/' and source 'https://github.com/CocoaPods/Specs.git' included in Podfile

source 'https://cdn.cocoapods.org/'
source 'https://github.com/CocoaPods/Specs.git'

After removing source 'https://github.com/CocoaPods/Specs.git' the warnings gone.

like image 40
ViktoR Avatar answered Dec 20 '22 06:12

ViktoR