I am trying to write UI and Unit Tests for the application we are working on. To simplify the task, I wrote a class that accidentally creates objects from project classes, which can then be used by all test classes.
The problem I'm facing right now is that when creating user interface tests, the Mach-o linker throws some errors that speak Symbols not found for architecture ...and refer to my main project classes and this random object generator.
It is strange that for Unit Tests the same random generator works just fine!
In context: it doesn't matter if I run everything on a real device or a simulator (so the architecture argument doesn’t matter in the error)
My project is configured as follows:
- Workspace:
- Project: My project
- Purpose: unit tests
- Class RandomObjectGenerator
- Unit test 1
- Purpose: user interface tests
Note that the RandomObjectGenerator class is assigned to the following purposes:

Thus, my Unit / UI test classes always indicate @testable import MyProject.
This produces an error message during compilation:

While in the editor I can very easily refer to these classes ...
If anyone has an idea, I would be glad to hear that. I kinda do not pay attention to these errors :(
source
share