Carthage: dyld: Library not loaded: @rpath/XCTest.framework/XCTest

Created on 15 Sep 2015  路  10Comments  路  Source: Carthage/Carthage

I use Xcode Version 7.0 (7A218) with Carthage 0.8.0. My project is an iOS-App with Swift 2.
I use the following Cartfile

github "Quick/Nimble"
github "Quick/Quick"

I followed the "Getting started"-Guide and added both libraries to the project.
Building of the project works fine, but when I want to run the app in the simulator, I get the following error:

dyld: Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Users/joe/Library/Developer/CoreSimulator/Devices/C1593776-C1D8-4CFF-82F6-DE7D9A205946/data/Containers/Bundle/Application/8CEFE47A-03AB-49AB-865A-469D04DAACDD/MyApp.app/Frameworks/Quick.framework/Quick
  Reason: image not found
question

Most helpful comment

I have fixed this problem by removing Quick.framework and Nimble.framework from Build Phases of TARGETS

All 10 comments

  1. Use the correct version of Nimble for Swift 2, which is:

    github "quick/nimble" "v2.0.0-rc3"

  2. Nimble is looking for XCTest framework so add this to your Framework Search Path in your test target

    $(PLATFORM_DIR)/Developer/Library/Frameworks

Same problem here

I now use the correct version of Nimble. Thank you @taiheng for your hint.

I fixed the problem by copying the "XCTest.framework" to my project because adding $(PLATFORM_DIR)/Developer/Library/Frameworks to my Framework Search Path did not work either.

@taiheng where is the location of XCTest.framework ?

The full path for iOS Simulator is:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks

This should be equivalent to
$(PLATFORM_DIR)/Developer/Library/Frameworks

@taiheng I also got this error: dyld: Library not loaded: @rpath/XCTest.framework/XCTest Referenced from: /Users/guo/Library/Developer/Xcode/DerivedData/SwiftWeather-goddczgmgbbcuzczatjcaeqeisjv/Build/Products/Debug-iphonesimulator/Quick.framework/Quick Reason: image not found.
My Xcode's version is 7.3.0. I have added $(PLATFORM_DIR)/Developer/Library/Frameworks to Framework Search Path. It did not work. Can you help me ?
@rotespferd How do you copy the "XCTest.framework" to your project ?

I have fixed this problem by removing Quick.framework and Nimble.framework from Build Phases of TARGETS

Is this was even solved anyhow? Im currently testing on XCode 8.2.1 and the issue persist. I've already tried all suggestions but still crashing on load with the same error:

dyld: Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Users/rcfrias/Library/Developer/CoreSimulator/Devices/60C937CE-ED58-4551-B1A4-7CDBC301B351/data/Containers/Bundle/Application/9915B114-E0C9-4861-9AD3-8AF1B9878F6E/QuickNimbleApp.app/QuickNimbleApp
  Reason: image not found

Ok!, to make it work with CocoaPods and XCode 8.2.1, you need to copy XCTest.framework FROM THE IPHONE SIMULATOR FRAMEWORK location, and NOT from the iphone location.

On my machine, this is located at:
/Applications/Xcode8.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework

Copy that file to xcode, (anywhere) I used the Frameworks folder created by CocoaPods, and the final step is to include that file at General Tab, Embedded binaries and bum, no more crash!

I have fixed this problem by deleting Podfile.lock and install pods again

Was this page helpful?
0 / 5 - 0 ratings