iOS CocoaPods 版本安装问题

今天安装salesforce中的pods,这是里面的podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'

target 'Hellow2' do

source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git' # need to be first 
source 'https://github.com/CocoaPods/Specs.git'

pod 'React', :path => './node_modules/react-native', :subspecs => [
    'ART',
    'RCTActionSheet',
    'RCTAdSupport',
    'RCTCameraRoll',
    'RCTGeolocation',
    'RCTImage',
    'RCTNetwork',
    'RCTPushNotification',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
    'RCTLinkingIOS'
]

pod 'SalesforceSDKCore'
pod 'SalesforceNetwork'
pod 'SalesforceRestAPI'
pod 'SmartStore'
pod 'SmartSync'
pod 'SalesforceReact'

end
pod 'SalesforceSDKCore' 这种写法应该就是使用最新的版本,但是我使用pod install时,控制台有如下输入:

 显示的是4.2.0版本,之后我去https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git 查看了一下,最新的版本是4.3.1

 

原来,虽然profile里有source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git',但是,这并不能保证本地的pods的 spec repo(描述仓库)是新的,我们需要手动运行pod repo update 更新pods 的 spec repo,这样系统才能从 spec repo中找到新版本的spec,进而才能下载到新的库。

升级后,再运行 pod install 有下图:

已经可以正确读取新的 spec文件了!

 

在运行pod install 之前,最好在工程目录下运行 pod repo update,更新pod的 spec 信息。

 

posted @ 2016-09-28 11:16  幻化成疯  阅读(427)  评论(0)    收藏  举报