6

I updated to xcode 10 from Xcode 9.4 and then when trying to run my UI tests nothing seems to be working. The test app loads for a while then test failed although the build is successfully done before the tests. and the source code builds successfully as well and I can run the app on the simulator.

The error is:

Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying error: The test runner failed to load the test bundle. Executable cannot be loaded for some other reason, such as a problem with a library it depends on or a code signature/entitlements mismatch.))

AyaAkl
  • 77
  • 6

2 Answers2

3

First, if you are using Cocoapods make sure your test target has the inherited search paths set up, something like that for instance :

# MARK: Common pods
abstract_target 'AppCommon' do
  pod 'Alamofire'

  target 'MyFrameworkA' do
    project './MyPath/MyFrameworkA/MyFrameworkA.xcodeproj'

    target 'MyFrameworkATests' do
      inherit! :search_paths
    end
  end
end

Next, in your Build phases of your FrameworkA, make sure that any other frameworks (B, C used in A), are set up as target dependencies AND added to the Linked Binary With Libraries.

Finally, make sure your FrameworkATests target have your FrameworkA in Target Dependencies and is added in the Linked Binary With Libraries phase too.

jc_35
  • 1,073
  • 1
  • 9
  • 15
  • But I need to understand why this was happening. what is the difference now in Xcode10? – AyaAkl Nov 06 '18 at 16:11
  • 1
    Great news! Forget my question about Xcode 10, I had the same issue and my debugging was in progress. It's the same with Xcode 9 if I remember well. But the compiling issue may also be related to the new Build System updates. You can see it in the File / Workspace Settings / New Build System (Default). – jc_35 Nov 07 '18 at 16:02
  • Also make sure you don't import any pods twice, f.e. by declaring it again at a subtarget – Daniel Apr 23 '19 at 12:29
2

Xcode 10 introduced new build system which parallelise the most of the building talks including the dependencies. The new build system can detect most of the configuration issues. Must of the projects which has unusual configuration started to fail and new build system has detected this. All things that you should know about build system https://www.xcteq.co.uk/xcblog/five-things-you-must-know-about-xcode-10-new-build-system/

Shashi
  • 21
  • 1