How to fix this is described in the Cocoapod repo, issue 6089.
Jest of it copied here in case link breaks in the future:
- Starting point
I try to create a private pod.
looks like this
.
├── LICENSE
├── MoudlePod3
│ ├── 0.0.1
│ │ └── MoudlePod3.podspec
│ ├── TestObject3.h
│ └── TestObject3.m
├── MoudlePod3.podspec
└── README.md
Everything is perfect!
- Change creating the issue:
Then I add some new folder and files to the pod
Updated pods file tree:
.
├── LICENSE
├── MoudlePod3
│ ├── 0.0.1
│ │ └── MoudlePod3.podspec
│ ├── 0.0.4
│ │ └── MoudlePod3.podspec
│ ├── NewClass
│ │ ├── TestObjectNew.h
│ │ └── TestObjectNew.m
│ ├── TestObject3.h
│ └── TestObject3.m
├── MoudlePod3.podspec
└── README.md
Increment podspec version to 0.0.4
Update client's podfile as follow:
Demo Project Pod file:
source 'https://github.com/CocoaPods/Specs.git'
source 'http:///ljb/MoudlePod3.git'
target 'MoudleApp' do
pod 'MoudlePod3', '~> 0.0.4'
end
run pod install
[!] An unexpected version directory NewClass was encountered for the /Users/apple/.cocoapods/repos/MoudlePod3/MoudlePod3 Pod in the MoudlePod3 repository.
- Explanation & solution from @benasher44 :
Ah, so source 'http:///ljb/MoudlePod3.git' means that it expects that to be a specs repo, but it looks like you're trying to combine a specs repo and the repo where you keep the code for your pod, which is unsupported.
You should instead remove the custom source line and do something like pod 'MoudlePod3', '~> 0.0.4', :git => ''. Checkout https://guides.cocoapods.org/using/the-podfile.html#from-a-podspec-in-the-root-of-a-library-repo for more info.
or in my case fix the source line to point to the private specs repo not the pod's source repo... Doh!
Hope that helps.