如何更新iOS App Swift中的Pod

时间:2016-11-21 05:40:30

标签: ios cocoapods

我有一个pod文件,如下所示 -

# Uncomment this line to define a global platform for your project

platform :ios, '8.0'

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

target 'OSLMobile' do

pod 'AFNetworking'

pod 'libPhoneNumber-iOS', '~> 0.8'

end

target 'OSLMobileTests' do

pod 'AFNetworking'

pod 'libPhoneNumber-iOS', '~> 0.8'

end

我想更新图书馆&#lib; libPhoneNumber-iOS'。为此,我将进入我的项目目录并输入 pod update libPhoneNumber-iOS

但是这给了我错误 -

[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named master。 您可以尝试在~/.cocoapods/repospod repo add手动添加。

有些人可以帮助我如何更新libPhoneNumber-iOS

其他细节 - XCode 8.0,Swift 2.3

感谢。

4 个答案:

答案 0 :(得分:1)

运行pod init

如果你得到[!] Existing Podfile found in Directory

转到~/.cocoapods/repos并运行git clone https://github.com/CocoaPods/Specs.git master

然后运行你的

pod update libPhoneNumber-iOS

Reference

答案 1 :(得分:1)

转到~/.cocoapods/repos并运行

git clone https://github.com/CocoaPods/Specs.git master

引自here

答案 2 :(得分:0)

无需指定来源。

platform :ios, '8.0'
use_frameworks!        
target 'OSLMobile' do 
pod 'AFNetworking'    
pod 'libPhoneNumber-iOS', '~> 0.8'    
end

target 'OSLMobileTests' do    
pod 'AFNetworking'    
pod 'libPhoneNumber-iOS', '~> 0.8'    
end

在安装或更新pod之前,还要更新主仓库。您可以在终端中使用命令更新主仓库。

  

pod repo update

答案 3 :(得分:0)

iOS9:

# Uncomment this line to define a global platform for your project
# platform :ios, ‘9.0’

pod 'Alamofire'
pod 'libPhoneNumber-iOS', '~> 0.8'

target 'OSLMobile' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for OSLMobile

target 'OSLMobileTests' do
 inherit! :search_paths
 # Pods for testing
end

target 'OSLMobileUITests' do
 inherit! :search_paths
 # Pods for testing
end