Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building Xcode UITest fails with `error opening input file`

I added a UITest target to my existing Xcode project.

Recording a UITest works fine. But running the same recorded UITest fails during build with error:

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

The path is correct and the file exists at the path.

  • Tried to add the file to the target, but I cannot add it to any target because the checkboxes are greyed out.
  • Tried to clean the build folder and delete the derived data folder, same issue.

Any ideas?

like image 245
Manuel Avatar asked Mar 12 '26 16:03

Manuel


1 Answers

The solution was to change the path to the Bridging Header file.

  1. Select the test target, e.g. MyAppUITests
  2. Navigate to Build Settings > Swift Compiler - General > Objective-C Bridging Header.
  3. Replace the existing path to your header file, e.g. MyApp/MyApp-Bridging-Header.h with ./MyApp/MyApp-Bridging-Header.h. Adding the . will allow the test target to find the header file.
like image 107
Manuel Avatar answered Mar 15 '26 07:03

Manuel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!