5

I'm using an in-house cocoapod called temple8 in an app that I'm building. Here's my Podfile:

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 reference parts of temple8 in my tests which is why I've included it in both test targets. But then when I run any of my tests, I get a long list of errors like this:

objc[83693]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x112334998) and /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.

I initially thought that the duplication of classes was caused by including temple8 in both the test targets and the app's target. But if I remove temple8 from the test targets, any time I try to use @testable import ... in my tests, I get a

Failed to import bridging header...

build error. Meaning that the temple8 header files in the app's bridging header cannot be found by the tests. So I'm unsure what the best approach is here.

Adam Colvin
  • 751
  • 1
  • 6
  • 16

2 Answers2

4

As far as I know that warning is not something you did. I think I saw some other people having the same issue and as far as I can tell it's a problem in the latest SDK from Apple. I say you can safely ignore it for now. Here are some people having the same issues:

Check this answer to get more info.

Community
  • 1
  • 1
Mihai Fratu
  • 7,579
  • 2
  • 37
  • 63
  • Well it sounds like I'm prohibited from writing unit tests until Apple solves this problem. Not a great situation... Thankfully most of the app's logic is in temple8 itself, which is well tested. – Adam Colvin Feb 20 '17 at 10:18
1

I don't think you'll need the temple8 inside your test targets - it should just be the libraries for testing: Here's an example.

orta
  • 4,225
  • 1
  • 26
  • 34
  • If I remove temple8 from the test targets, any time I try to import my app into a test using `@testable import`, then I see the `Failed to import bridging header` build error – Adam Colvin Feb 10 '17 at 19:52