Headers are not found after updating CocoaPods

2019-06-25 13:53发布

I updated CocoaPods today (sudo gem install cocoapods). After performing pod install the project won't compile anymore. It seems that headers from the pod are not longer found by the project.

Did something change in the recent cocoa pods version(s)?

The following is my pod file:

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '7.0'

inhibit_all_warnings!

pod 'CocoaLumberjack'
pod 'RestKit', '~> 0.20.0'
pod 'RestKit/Testing'
pod 'NLTHTTPStubServer'
pod 'Appsee'

pod 'google-plus-ios-sdk', '1.7.0'

2条回答
劳资没心,怎么记你
2楼-- · 2019-06-25 14:20

I was in the same position as you, and finally decided to roll back the CocoaPods version I had installed (which solved my problem)

Luckily my Podfile.lock file was under version control, so I pulled up the file to see what the last version of Cocoapods I had used. The last line of my Podfile.lock was:

COCOAPODS: 0.33.1

So here is how I solved my issue

sudo gem uninstall cocoapods

sudo gem install cocoapods -v 0.33.1

rm -rf Pods

pod install
查看更多
啃猪蹄的小仙女
3楼-- · 2019-06-25 14:24

Fix is simple and the error tells what to do. Add this to the top of your Podfile:

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

Here's the Github issue with more details - https://github.com/CocoaPods/CocoaPods/issues/2515

Update

Make sure you create the Podfile in the root of your Xcode project directory. Here's what your Podfile should look like -

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '7.0'
inhibit_all_warnings!

# Pods
pod 'RestKit', :head
pod 'RestKit/Testing', :head
pod 'CocoaLumberjack', :head
pod 'NLTHTTPStubServer', :head
pod 'Appsee', '~> 2.1'
pod 'google-plus-ios-sdk', '~> 1.7.0'

In your terminal -

  • Update RubyGems - sudo gem update
  • Update Cocoa Pods - sudo gem install cocoapods

In your project directory -

  • Remove pods - rm -rf Pods/
  • Install pods - pod install
查看更多
登录 后发表回答