0

问题:突然,我使用 Xcode 10 创建的项目中的测试目标开始失败,并显示消息“import Quick could not find module”。

其他详细信息:如果我不构建主要目标,则测试目标将在找不到“FirebaseCore/FirebaseCore.h”文件时失败。我还可以看到,仅构建测试目标 [之前清理项目] 不会触发任何依赖项的构建,无论是来自主目标还是测试目标依赖项。

Podfile 看起来像这样

ENV['COCOAPODS_DISABLE_STATS'] = "true"
platform :ios, '10.0'

use_frameworks!

target 'MyProject' do
  pod 'Firebase/Core'
  pod 'Crashlytics'
  pod 'Alamofire'
  pod 'KeychainSwift'

  target 'MyProjectTests' do 
    inherit! :search_paths

    pod 'Quick'
    pod 'Nimble'
  end

  target 'MyProjectUITests' do
    inherit! :complete   
  end
end

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          if config.name == 'Debug'
            config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES'
          end
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        end
    end
end

我该如何解决这个问题并确保测试目标的构建触发所有依赖项的构建,无论是来自主目标还是它自己的依赖项?

4

1 回答 1

0

Solution:

Make sure "YourTestSchema" -> edit schema -> build -> find implicit dependencies is ticked on

Additional details: Due to Quick having a cycle dependency according to Xcode 10 new building system, I turned this setting of and never though of it again until my CI failed. Make sure you're not doing the same mistake.

于 2018-10-08T10:35:44.857 回答