1

I have a project that is several years old, and I now want create a new feature in Swift. However, I cannot get the unit tests to run after I have inserted the first swift file. The tests compile, and the simulator is started. But before the tests start to run, I get this error:

Simulator session started with process 58478
Debugger attached to process 58478
IDEBundleInjection.c: Error 3587 loading bundle '/Users/jrv/Library/Caches/AppCode32/DerivedData/MobileBank-542f20a4/Build/Products/Debug-iphonesimulator/Test.xctest': The bundle “Test.xctest” couldn’t be loaded because it is damaged or missing necessary resources.
DevToolsBundleInjection environment:
XCInjectDiagnostics: (null)
XCInjectBundleInto: /Users/jrv/Library/Caches/AppCode32/DerivedData/MobileBank-542f20a4/Build/Products/Debug-iphonesimulator/Sydbank.app/Sydbank
XCInjectBundle: /Users/jrv/Library/Caches/AppCode32/DerivedData/MobileBank-542f20a4/Build/Products/Debug-iphonesimulator/Test.xctest
TestBundleLocation: (null)
TMPDIR: /Users/jrv/Library/Developer/CoreSimulator/Devices/8016383A-A404-4D35-BDCB-0ED5317AD44A/data/Containers/Data/Application/CA2E7792-CA10-4109-B95E-7B0CA9D18147/tmp
DYLD_LIBRARY_PATH: /Users/jrv/Library/Caches/AppCode32/DerivedData/MobileBank-542f20a4/Build/Products/Debug-iphonesimulator
DYLD_INSERT_LIBRARIES: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection
DYLD_FRAMEWORK_PATH: /Users/jrv/Library/Caches/AppCode32/DerivedData/MobileBank-542f20a4/Build/Products/Debug-iphonesimulator
DYLD_FALLBACK_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
DYLD_FALLBACK_FRAMEWORK_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks

Even the simplest swift file gives the same error:

import Foundation
class MyTests: XCTestCase {
}

Searching Stack Overflow have given several suggestions. I have tried to remove code signing, I have ensured I am using XCTest, I have changed my framework search paths, I have Symbols hidden by Default = NO, and I have ensured that my bridging headers are correctly configured.

Any suggestions will be greatly appreciated...

Community
  • 1
  • 1
JRV
  • 1,702
  • 1
  • 17
  • 27

1 Answers1

0

I tried creating a new test target for my Swift files, and this target worked. Then I compared the configuration, parameter by parameter, between my old test target and the new one. I finally identified one parameter that caused the tests to run when I set it on my test target:

Build settings for test target: LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"

Full setting:

LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"

To be honest, I don't know what this means, but it works.

JRV
  • 1,702
  • 1
  • 17
  • 27
  • Unfortunately setting this configuration for some reason die not allow my main program to link: I have @executable_path/../Frameworks and @loader_path/../Frameworks. At any rate replacing these it compiles but testing represents the Injection issue. – Fabrizio Bartolomucci Jul 10 '15 at 20:06