私が構築しているアプリでは、社内のココアポッド(temple8)を使用しています。私は両方のテストターゲットでそれを含めました理由であるユニットテストでCocoapodを使用できません
platform :ios, '9.0'
def temple8
pod 'j2objc-temple8-debug', :configuration => ['Debug'], :path => '../temple8/build/j2objcOutputs'
pod 'j2objc-temple8-release', :configuration => ['Release'], :path => '../temple8/build/j2objcOutputs'
end
target 'cartful-ios' do
use_frameworks!
temple8
pod 'Stripe'
pod 'Alamofire', '~> 4.0'
pod 'FontAwesomeKit', :git => 'https://github.com/PrideChung/FontAwesomeKit.git'
pod 'KeychainAccess'
pod 'pop', '~> 1.0'
pod 'libPhoneNumber-iOS', '~> 0.8'
pod 'AsyncDisplayKit', :git => 'https://github.com/facebook/AsyncDisplayKit.git'
pod 'Intercom'
pod 'Mixpanel-swift'
pod 'UICountingLabel'
pod 'DTFoundation'
target 'cartful-iosTests' do
inherit! :search_paths
temple8
end
target 'cartful-iosUITests' do
inherit! :search_paths
temple8
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
私は私のテストでtemple8の部分を参照する必要があります。ここに私のPodfileです。私は私のテストのいずれかを実行したときしかし、その後、私はこのようなエラーの長いリストを取得:
にObjC [83693]:クラスPLBuildVersionは両方 /Applications/Xcode.app/Contents/Developer/Platformsに実装されています/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x112334998)と /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs /iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x112156880)。 2つのうちの1つが使用されます。どちらが未定義ですか。
私は当初、テストターゲットとアプリケーションのターゲットの両方にtemple8を組み込むことによってクラスの複製が発生したと考えました。私は、テスト対象からtemple8を削除した場合でも、私は私のテストで@testable import ...
を使用しようとする任意の時間は、私が
Failed to import bridging header...
ビルドエラーを取得します。テストでブリッジのヘッダーファイルにあるtemple8ヘッダーファイルが見つからないことを意味します。だから私は最良のアプローチがここにあるのかよく分からない。
まあ、 Appleがこの問題を解決するまで、単体テストの作成は禁じられていた。素晴らしい状況ではありません...ありがたいことに、アプリのロジックの大部分はテンプル8自体にあり、よくテストされています。 – AdColvin