每当我构建我的测试目标(Xcode生成的标准目标)时,构建就会失败并出现一个神秘的错误:
framework not found Pods_AppName_AppNameTests
我认为这意味着我的测试的pod生成目标无法找到。 我的podfile非常简单:
use_frameworks!
target 'AppName' do
pod 'ReactiveCocoa'
pod 'RealmSwift'
pod 'ObjectMapper'
pod 'Moya'
pod 'Moya/ReactiveCocoa'
pod 'pop'
pod 'Heimdallr'
pod 'Heimdallr/ReactiveCocoa'
pod 'Alamofire'
pod 'AlamofireImage'
pod 'SwiftDate'
pod 'DropdownAlert'
pod 'NibDesignable'
target 'AppNameTests' do
pod 'Quick'
pod 'Nimble'
end
end
我正在使用Cocoapods 1.0.1。
编辑:
它不是我的podfile的格式。这是通过运行pod init给我的默认设置。 cocoapods中可能存在一个错误,但格式是正确的。
编辑2:
如果我包括:
inherit! search_paths
在我的测试目标中,测试失败说:
The bundle “MyApp_Tests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
如果没有该行,测试也无法构建,但这次出现了链接器错误:
Ld /Users/travis/Library/Developer/Xcode/DerivedData/Reactify-fqgxzcgedmqljrangqdkxpwdfxne/Build/Intermediates/Reactify.build/Debug-iphonesimulator/Reactify_Tests.build/Objects-normal/i386/Reactify_Tests normal i386
特殊错误来自Travis,但我在Xcode中获得了同样的错误。