Cannot use Cocoapod in unit tests

I am using my own cocoapod called temple8 in the application I am creating. Here is my subfile:

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 

I need to refer to parts of temple 8 in my tests, so I included it in both targets. But then when I run any of my tests, I get a long list of errors like this:

objc [83693]: the PLBuildVersion class is implemented as in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibrarySer99vices.fervices1ervices.fir1er33fservices_fracks 0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x112156880). One of the two will be used. Which one is undefined.

Initially, I thought that class duplication was caused by the inclusion of the temple8 in both the target objects and the target applications. But if I remove temple8 from the test targets, every time I try to use @testable import ... in my tests, I get

 Failed to import bridging header... 

Build error. This means that temple8 header files in the application header cannot be found in tests. So I'm not sure what the best approach is here.

+5
source share
2 answers

As far as I know, this warning is not what you did. I think I saw other people having the same problem, and as far as I can tell, this is a problem in Appleโ€™s latest SDK. I say that you can safely ignore him now. Here are some people having the same problems:

Check this answer for more information.

+3
source

I do not think that you will need temple8 inside your test goals - these should be libraries for testing: here is an example .

+1
source

Source: https://habr.com/ru/post/1264041/


All Articles