Running unit tests in Xcode 8 throws the error "failed to load the inserted library" ... / IDEBundleInjection because the image was not found "

I unexpectedly encounter an error while testing my iOS 10 application in Xcode 8.

dyld: could not load inserted library '__PLATFORMS__/iPhoneOS.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection' because image not found 

Application tests have been successfully completed previously. Then I deleted the skeleton UI Test Case class that was created with the project, so this can cause a problem (somehow). Since then, I recreated this class, but the problem remains.

What exactly the error message indicates and how I can solve this problem, that is, successfully run the application module tests again.

UPDATE There should be a different root case: if I create another (empty) Single View application project in Xcode and run its unit tests, the same error occurs.

The error occurs only when performing unit tests on the device, and not on simulators.

UPDATE This Apple response to a similar report suggests that the error is due to code signing. The application itself works fine on one device, since there may be a problem with fake code in my case?

+5
source share
2 answers

Try one at a time:

  • Try creating a new UnitTest goal by copying everything and deleting the old one.

  • In the General panel, do not leave the No command. Choose your team. And select the correct code signature identification from the settings. It was set to non-default - changed to "IOS Developer" to record Debug settings.

  • Disable "Enable Malloc Protection" from diagnostics to run the application on the device.

  • Perhaps this is due to the fact that Xcode is mounting the wrong DeveloperImage. If you open "Settings-> Developer", you will see that "Enable UIAutomation" and others are missing. To fix it:

    (A) move all folders with "/Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport", except for "10.0 (12A4297e)" to a safe place (B) restart the phone (C) connect the phone to xCode 8 (D) restore folders in DeviceSupport

    This is the only thing that helped me. Even blinking repeatedly on the ios10 doesn't help.

  • This is old, but it can help you: on the General tab, there is a field called “Embedded binaries”. When you add the framework, the crash is fixed.

Link https://devforums.apple.com/message/991384#991384 on the Apple Developer Forums.

Good luck

+2
source

The Xcode testing framework has a restart mechanism that detects test failures and attempts to restart testing to complete any remaining tests. There may be a problem with how this mechanism sets up DYLD_INSERT_LIBRARIES after a failure in your tests - please write a report at https://bugreport.apple.com and attach yours if possible.

0
source

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


All Articles