迁移到CocoaPods 1.0.1 [英] Migrating to CocoaPods 1.0.1
问题描述
我正在尝试将现有的CocoaPod配置从0.39.0迁移到1.0.1。
I am trying to migrate our existing CocoaPod configuration from 0.39.0 to 1.0.1.
我们现有的 Podfile
看起来像这样:
Our existing Podfile
looks like:
platform :ios, '9.0'
use_frameworks!
target 'Tools' do
pod 'zipzap', '~> 8.0.4'
pod 'Argo', '~> 2.2.0'
pod 'Curry', :git => 'https://github.com/thoughtbot/Curry.git', :commit => 'eeb459fac309833288e61e134a4e8fad649e99b0'
end
target 'ToolsTests' do
end
已编译,并且测试以前运行良好。 遵循迁移指南之后。我重构了 Podfile
像这样:
This compiled and the tests ran just fine previously. After following the migration guide. I restructured the Podfile
like so:
platform :ios, '9.0'
target 'Tools' do
use_frameworks!
pod 'zipzap', '~> 8.0.4'
pod 'Argo', '~> 2.2.0'
pod 'Curry', :git => 'https://github.com/thoughtbot/Curry.git', :commit => 'eeb459fac309833288e61e134a4e8fad649e99b0'
target 'ToolsTests' do
inherit! :search_paths
end
end
此编译和链接很好。不幸的是,当测试运行时,它们崩溃:
This compiles and links just fine. Unfortunately when the tests run they crash with:
2016-06-07 12:04:06.265 xctest[56474:789900] The bundle "ToolsTests" couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-06-07 12:04:06.299 xctest[56474:789900] (dlopen_preflight($HOME/Library/Developer/Xcode/DerivedData/Tools-dbmncsubtoarlhhcrpchrswefprz/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ToolsTests.xctest/ToolsTests): Library not loaded: @rpath/Argo.framework/Argo
Referenced from: $HOME/Library/Developer/Xcode/DerivedData/Tools-dbmncsubtoarlhhcrpchrswefprz/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ToolsTests.xctest/ToolsTests
Reason: image not found)
Program ended with exit code: 82
在迁移指南中说:
我们收到的大部分错误报告是由于模棱两可在Podfile中。它提供了很多自由来创建各种CocoaPods设置,这些设置可以通过实施细节的运气来工作,或者可以工作,但是比所需的复杂得多。
A large fraction of the bug reports we receive is due to ambiguity in the Podfile. It gave a lot of freedom to create all kinds of CocoaPods setups that would work by luck of implementation details, or work but are significantly more complex than they needed to be.
这是否曾经是靠运气实现细节的案例之一?如果不是,正确 Podfile
语法是什么?
Is this one of those cases that used to "work by luck of implementation details"? If not what is the correct Podfile
syntax?
我应该注意是否重复 ToolsTests
中的 pod
定义一切正常。虽然这感觉错误。
I should note if I duplicate the pod
defs in the ToolsTests
everything works just fine. Though this feels wrong.
推荐答案
类似的问题: Cocoapods测试链接器错误
升级似乎是人们面临的常见问题。您的新 Podfile
对我来说很合适。
Seems to be a common problem people are facing when upgrading. Your new Podfile
looks right to me.
如果您还没有,我会尝试:
If you haven't already, I would try:
清理构建文件夹(在Xcode中-> Option + Shift + Command + K)
cleaning the build folder (in Xcode -> Option+Shift+Command+K)
清理派生数据文件夹( rm -rf〜/ Library / Developer / Xcode / DerivedData
)
clearing the derived data folder (rm -rf ~/Library/Developer/Xcode/DerivedData
)
清除CocoaPods缓存( rm -rf〜/ Library / Caches / CocoaPods
)
clearing your CocoaPods cache (rm -rf ~/Library/Caches/CocoaPods
)
并运行 pod install
再次
编辑:
我上面提到的问题现在有一个答案:https://stackoverflow.com/a/37705768/3067051
这篇关于迁移到CocoaPods 1.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!