xcode Cocoapods“pod update”安装旧的pods
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34509310/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cocoapods "pod update" installs old pods
提问by youritrg
I am trying to set up CI on Xcode Server by creating a bot for an iOS app. I use CocoaPods so I'm using the script below to install the pods:
我正在尝试通过为 iOS 应用程序创建机器人来在 Xcode Server 上设置 CI。我使用 CocoaPods,所以我使用下面的脚本来安装 pod:
export LANG=en_US.UTF-8
#!/bin/bash
cd "$XCS_SOURCE_DIR/{PROJECTNAME}"
if [ -e "Pods" ]
then
/usr/local/bin/pod update
else
/usr/local/bin/pod install
fi
The current version of CocoaPods 0.39.0 is installed on the server. When I run "pod update" on the server everything is alright and the newest pods are installed.
当前版本的 CocoaPods 0.39.0 安装在服务器上。当我在服务器上运行“pod update”时,一切正常,并且安装了最新的 pod。
Using FBAudienceNetwork (4.7.0)
Using FBSDKCoreKit (4.8.0)
Using Fabric (1.6.1)
Using FyberSDK (8.1.2)
Using Google-Mobile-Ads-SDK (7.6.0)
Using GoogleAnalytics (3.14.0)
When I use the script above however something strange happens.
然而,当我使用上面的脚本时,发生了一些奇怪的事情。
Installing FBAudienceNetwork (4.1.0)
Installing FBSDKCoreKit (4.4.0)
Installing Fabric (1.2.8)
Installing FyberSDK (7.2.4)
Installing Google-Mobile-Ads-SDK (7.3.1)
Installing GoogleAnalytics (3.13.0)
Anyone has any idea why old versions are installed with the script? I use OS X Server 5.0.15 and Xcode 7.2.
任何人都知道为什么旧版本与脚本一起安装?我使用 OS X Server 5.0.15 和 Xcode 7.2。
The podfile:
播客文件:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.0"
use_frameworks!
target "{PROJECTNAME}" do
inhibit_all_warnings!
pod 'AFNetworking'
pod 'Branch'
pod 'SwrveSDK'
pod 'RealmSwift'
pod 'MZTimerLabel'
pod 'pop'
pod 'Adjust'
pod 'JSQMessagesViewController'
pod 'Fabric'
pod 'Crashlytics'
pod 'GoogleAnalytics'
pod 'FBSDKCoreKit'
pod 'FyberSDK'
pod 'AdColony'
pod 'Google-Mobile-Ads-SDK'
pod 'ChartboostSDK'
pod 'FBAudienceNetwork'
pod 'VungleSDK-iOS'
end
target "{PROJECTNAME}Tests" do
inhibit_all_warnings!
pod 'AFNetworking'
pod 'Branch'
pod 'SwrveSDK'
pod 'RealmSwift'
pod 'MZTimerLabel'
pod 'pop'
pod 'Adjust'
pod 'JSQMessagesViewController'
pod 'Fabric'
pod 'Crashlytics'
pod 'GoogleAnalytics'
pod 'FBSDKCoreKit'
pod 'FyberSDK'
pod 'AdColony'
pod 'Google-Mobile-Ads-SDK'
pod 'ChartboostSDK'
pod 'FBAudienceNetwork'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
回答by youritrg
I've got it working now! I didn't know about the _xcsbuildd user which does the builds. I found more about this here: https://honzadvorsky.com/articles/2015-08-17-17-30-xcode_server_tutorials_3_prebuild__postbuild_scripts/
我现在已经开始工作了!我不知道进行构建的 _xcsbuildd 用户。我在这里找到了更多相关信息:https: //honzadvorsky.com/articles/2015-08-17-17-30-xcode_server_tutorials_3_prebuild__postbuild_scripts/
So after logging in as this user I saw the same problem in the terminal on the server. Old versions of the pods were downloaded. The master repository of CocoaPods has some error, so I did
因此,以该用户身份登录后,我在服务器的终端中看到了同样的问题。已下载旧版本的 pod。CocoaPods 的主仓库有一些错误,所以我做了
rm -rf ~/.cocoapods/repos/master
Then I ran
然后我跑了
pod setup --verbose
And the master repository with the Cocoapods specs was installed again. Now it works!
并再次安装了具有 Cocoapods 规范的主存储库。现在它起作用了!
回答by UKDataGeek
For those of you encountering this issue with newer libraries like:
对于那些在使用较新的库时遇到此问题的人,例如:
- Facebook login
- 'FBSDKLoginKit'
- 'FBSDKShareKit'
- 'FBSDKCoreKit'
- Facebook登入
- 'FBSDKLoginKit'
- 'FBSDKShareKit'
- 'FBSDKCoreKit'
you need to update your cocoapods to the latest version ( currently 1.2)
你需要将你的 cocoapods 更新到最新版本(目前是 1.2)
I did the following which worked: (Warning Cocoapods seems to sit idling for ages but I guess its doing something. ) Follow the first two steps from @youritrg above in terminal:
我做了以下工作:(警告 Cocoapods 似乎闲置了很长时间,但我想它正在做某事。)按照上面@youritrg 在终端中的前两个步骤进行操作:
rm -rf ~/.cocoapods/repos/master
pod setup --verbose
You should now have an refreshed installation. I then updated by doing:
您现在应该有一个更新的安装。然后我通过以下方式更新:
sudo gem install cocoapods
After installation the Facebook Cocoapods installed perfectly.
安装后,Facebook Cocoapods 安装完美。
回答by u.gen
For me uninstalling everything then removing the master repo worked
对我来说,卸载所有内容然后删除主存储库工作
gem list --local | grep cocoapods
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
sudo gem uninstall cocoapods-downloader
sudo gem uninstall cocoapods-plugins
sudo gem uninstall cocoapods-search
sudo gem uninstall cocoapods-stats
sudo gem uninstall cocoapods-trunk
sudo gem uninstall cocoapods-try
then
然后
rm -rf ~/.cocoapods/repos/master
sudo gem install cocoapods
then
然后
pod setup --verbose
回答by mwanjajoel
Running pod repo update
fixed this error for me
运行pod repo update
为我修复了这个错误
回答by Iain Coleman
Sorry for digging up an old thread, but I had a similar problem with Firebase/Admob not updating. I got the same error as others have mentioned above. I tried everything mentioned above, but for me, the only way I could get the pods to update correctly was to comment out the line
很抱歉挖掘了一个旧线程,但我在 Firebase/Admob 没有更新时遇到了类似的问题。我遇到了与上面提到的其他人相同的错误。我尝试了上面提到的所有内容,但对我来说,让 Pod 正确更新的唯一方法是注释掉该行
use_frameworks!
I know that this should be included as I am using Swift, but it seems to work fine now. If anyone has any thoughts on why, I would love to know what is going on!
我知道这应该在我使用 Swift 时包括在内,但它现在似乎工作正常。如果有人对原因有任何想法,我很想知道发生了什么!