Periodically Unable to Run Unit Tests in Xcode 8

I upgraded to Xcode 8 and I go through hell to run my tests sometimes ... For example, I just tested some code and could run my tests 3 times in a row ... and then for the 4th time I got:

dyld: failed to load the inserted PLATFORM library /iPhoneOS.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection 'because the image was not found

*** If you think this error is an error, attach the log file to / Users / patrick / Library / Developer / Xcode / DerivedData / MyApp -hjfppqmgxqrprucknvwtakynpqxs / Logs / Test / 2B6C2EAE-5C13-40C9-BACE- 3A00AA74F3ession -UnitTests-2016-09-20_124123-gk3pW0.log

I rebooted my iOS device, rebooted my computer, deleted derrived data, etc. He will no longer run tests. ARRRGH !!!!

UPDATE

I have to mention, I'm trying to run tests on my iPad, I can’t run tests on the simulator because I have too much code related to the built-in NEON functions and therefore the simulator does not start.

But what seems to work when this happens switches to creating tests on my iPhone, and then when it builds, it just says that the “running tests” and the spinner spin forever, but the tests are not actually executed. I can actually click on my application and interact with it, which is usually not the behavior that I get when running tests ... In any case, I stopped the build, switched to my iPad and now the tests run again.

+4
source share
2 answers

XCode 8.0, iPad ( 10.0.2 (14A456)), , . , , .

unit test , XCode .

, XCode; . unit test , "image not found".

, , :

  • iOS
  • iPad
  • iPad.
  • .

, ;

, , unit test; nil , , .

: , , , , , , " ". - , XCode .

  Assertions: failed: caught "NSInvalidArgumentException", "-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance 0x1818f200"
(
    0   CoreFoundation                      0x1dd89e1f <redacted> + 154
    1   libobjc.A.dylib                     0x1cfef077 objc_exception_throw + 38
    2   CoreFoundation                      0x1dd8f515 <redacted> + 0
    3   CoreFoundation                      0x1dd8d589 <redacted> + 700
    4   CoreFoundation                      0x1dcb2f08 _CF_forwarding_prep_0 + 24
    5   tDefense                            0x000cd299 +[PlayingPiece addPlayingPiece:atLocation:onBoard:] + 326
    6   tDefense                            0x000cd5ad +[PlayingPiece addNewPiece:atLocation:onBoard:] + 154
    7   tDefenseTests                       0x00410777 -[PlayFieldTests testGetNeighbors] + 4594
    8   CoreFoundation                      0x1dd8e864 <redacted> + 68
    9   CoreFoundation                      0x1dcaf349 <redacted> + 294
    10  XCTest                              0x00307de5 __24-[XCTestCase invokeTest]_block_invoke_2 + 472
    11  XCTest                              0x0033b0dd -[XCTestContext performInScope:] + 312
    12  XCTest                              0x00307c07 -[XCTestCase invokeTest] + 296
    13  XCTest                              0x00308439 -[XCTestCase performTest:] + 560
    14  XCTest                              0x0030578d -[XCTestSuite performTest:] + 520
    15  XCTest                              0x0030578d -[XCTestSuite performTest:] + 520
    16  XCTest                              0x0030578d -[XCTestSuite performTest:] + 520
    17  XCTest                              0x002f1d55 __25-[XCTestDriver _runSuite]_block_invoke + 52
    18  XCTest                              0x00312325 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 628
    19  XCTest                              0x002f1bed -[XCTestDriver _runSuite] + 512
    20  XCTest                              0x002f29b7 -[XCTestDriver _checkForTestManager] + 300
    21  XCTest                              0x0033c55b _XCTestMain + 690
    22  CoreFoundation                      0x1dd45bc3 <redacted> + 10
    23  CoreFoundation                      0x1dd455a7 <redacted> + 230
    24  CoreFoundation                      0x1dd43a61 <redacted> + 752
    25  CoreFoundation                      0x1dc93073 CFRunLoopRunSpecific + 486
    26  CoreFoundation                      0x1dc92e81 CFRunLoopRunInMode + 104
    27  GraphicsServices                    0x1f43bbfd GSEventRunModal + 156
    28  UIKit                               0x22e34acf <redacted> + 574
    29  UIKit                               0x22e2f201 UIApplicationMain + 150
    30  tDefense                            0x000d690f main + 106
    31  libdyld.dylib                       0x1d45e50b <redacted> + 2
)
  File: <unknown>
+2

Xcode 8/Swift 2.3. , Xcode .

+1

Source: https://habr.com/ru/post/1655243/


All Articles