【问题标题】:Building Xcode UITest fails with `error opening input file`构建 Xcode UITest 失败并出现“打开输入文件时出错”
【发布时间】:2018-03-10 12:13:44
【问题描述】:

我在现有的 Xcode 项目中添加了一个 UITest 目标。

录制 UITest 可以正常工作。 但是在构建过程中运行相同的记录 UITest 失败并出现错误:

Compile Swift source files
Precompile bridging header
<unknown>:0: error: error opening input file '/Users/<...>/Bridging-Header.h' (No such file or directory)

路径正确,该路径下存在文件。

  • 试图将文件添加到目标,但我无法将它添加到任何目标,因为复选框是灰色的。
  • 尝试清理构建文件夹并删除派生数据文件夹,同样的问题。

有什么想法吗?

【问题讨论】:

    标签: ios xcode xcode-ui-testing


    【解决方案1】:

    解决方案是更改Bridging Header 文件的路径。

    1. 选择测试目标,例如MyAppUITests
    2. 导航到Build Settings > Swift Compiler - General > Objective-C Bridging Header
    3. 替换头文件的现有路径,例如MyApp/MyApp-Bridging-Header.h./MyApp/MyApp-Bridging-Header.h。添加. 将允许测试目标找到头文件。

    【讨论】:

      猜你喜欢
      • 2021-08-22
      • 1970-01-01
      • 2019-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-07
      • 1970-01-01
      • 2021-11-27
      相关资源
      最近更新 更多