Xcode 5.0.2 dyld: Library not loaded: @rpath/XCTest.framework/Versions/A/XCTest
I have problems running a project in Xcode 5.0.2
I get the following error:
dyld: Library not loaded: @rpath/XCTest.framework/Versions/A/XCTest Referenced from: /Users/chris/Library/Developer/Xcode/DerivedData/relatio-cwlmozvklaldmictbbjthzuoxnxz/Build/Products/Debug/relatio.app/Contents/MacOS/relatio
Reason: image not found
How do I solve this issue?
- dyld issues library not loaded
- How do I add a third party Framework to iPhone project?
- DYLD_PRINT_STATISTICS not showing anything
- dyld: Library not loaded different behavior for 6.0 simulator/6.0 device
- dyld: Library not loaded, app requires AFNetworking 2.0.0 but provides version 1.0.0
- dyld symbol not found DictionaryGenerator (IOS Xcode6 Beta4)
9 Solutions Collect From Internet About “Xcode 5.0.2 dyld: Library not loaded: @rpath/XCTest.framework/Versions/A/XCTest”
It looks like your main target is linking to XCTest.framework as well as your test target. It should only be linked to the main target.
1) Go to Project settings
2) Go to your apps main target -> other linker flags
3) remove ‘-framework XCTest’
4) make sure the ‘other linker flags’ field for your test target still contains ‘-framework XCTest’
I ran into this error by renaming my targets one of which was a testing target. After reading the other answers I realized that my Build Phases > Compile Sources was including test classes as compile sources for non-test targets which then tried to import the XCTest framework.
Removing the test classes from my regular target’s Compile Sources solved this for my case.
The problem here is that, according to the dyld error message you posted, your application is linking against XCTest.framework. That’s incorrect; only your test bundle needs to link against XCTest.framework since only your test bundle contains tests.
I had similar problem with OCMock library and solution is:
target :"Application Tests", :exclusive => true do pod 'OCMock' end
This is how I solved the problem:
- Navigate to the project’s “Build Settings”
- Search for “Runpath Search Paths”
- Enter the following path in the column below the product name: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/
enter the reference of your framework on framework search path AND
Run path search path under “Build Settings”—…Now all set to invoke your projects by using import
In my main Target’s “Link Binary With Libraries” (under Build Phases), it was the testing framework I was using (Nimble.framework) that was causing the problem. Removed it, and everything’s fine!
I have same issue is because i add a new file into the framework. So just run “
pod install” solved my issue. But make sure your pod under
Tests target too.
I solved this problem this way.
I have edited scheme, at “Build” tab ticked “Run”.
- Compare current time with two times-of-day strings
- Sprite Kit – SKShapeNode Path not drawing Quad Curve
- creating back arrow shaped leftBarButtonItem on UINavigationController
- How to Properly Declare Array of Custom Objects in Swift?
- Horizontal center constraint issue in ios?
- Getting ARP table on iPhone/iPad
- Auto Layout and in-call status bar
- ASIHTTPRequest vs AFNetworking vs NSUrlRequest
- How to make NSSearchField send action upon autocompletion?
- UITabBarController with diffent storyboard file for each ViewController of the TabBar
- How do I perform a push segue within a container
- Xcode, Parse Crash Reporting, dSYM file not created
- Multiple apps with the same URL Scheme – iOS
- How to get the first N words from a NSString in Objective-C?