迁移到 CocoaPods 1.0.1
Migrating to CocoaPods 1.0.1
我正在尝试将我们现有的 CocoaPod 配置从 0.39.0 迁移到 1.0.1。
我们现有的 Podfile
看起来像:
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
这个编译和测试 运行 之前都很好。 After following the migration guide. 我像这样重组了 Podfile
:
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
这可以很好地编译和链接。不幸的是,当测试 运行 他们崩溃时:
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
迁移指南中说:
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.
这是以前 "work by luck of implementation details" 的案例之一吗?如果不是,正确的 Podfile
语法是什么?
我应该注意如果我在 ToolsTests
中复制 pod
defs 一切正常。虽然这感觉不对。
类似问题:
这似乎是人们在升级时面临的普遍问题。我觉得你的新 Podfile
很合适。
如果你还没有,我会尝试:
正在清理构建文件夹(在 Xcode -> Option+Shift+Command+K 中)
正在清除派生数据文件夹(rm -rf ~/Library/Developer/Xcode/DerivedData
)
正在清除您的 CocoaPods 缓存 (rm -rf ~/Library/Caches/CocoaPods
)
又是运行pod install
编辑:
我上面提到的问题现在有了答案:
我正在尝试将我们现有的 CocoaPod 配置从 0.39.0 迁移到 1.0.1。
我们现有的 Podfile
看起来像:
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
这个编译和测试 运行 之前都很好。 After following the migration guide. 我像这样重组了 Podfile
:
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
这可以很好地编译和链接。不幸的是,当测试 运行 他们崩溃时:
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
迁移指南中说:
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.
这是以前 "work by luck of implementation details" 的案例之一吗?如果不是,正确的 Podfile
语法是什么?
我应该注意如果我在 ToolsTests
中复制 pod
defs 一切正常。虽然这感觉不对。
类似问题:
这似乎是人们在升级时面临的普遍问题。我觉得你的新 Podfile
很合适。
如果你还没有,我会尝试:
正在清理构建文件夹(在 Xcode -> Option+Shift+Command+K 中)
正在清除派生数据文件夹(rm -rf ~/Library/Developer/Xcode/DerivedData
)
正在清除您的 CocoaPods 缓存 (rm -rf ~/Library/Caches/CocoaPods
)
又是运行pod install
编辑:
我上面提到的问题现在有了答案: