Nimble: Library not loaded: @rpath/Nimble.framework/Versions/A/Nimble

Created on 11 Jan 2016  Â·  7Comments  Â·  Source: Quick/Nimble

This is my output when trying to run the tests of this project (the separate-builds branch) for the PusherSwiftTests-OSX target (and scheme): https://github.com/pusher-community/pusher-websocket-swift/tree/separate-builds

2016-01-11 18:00:47.704 xctest[31397:828869] The bundle “PusherSwiftTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-01-11 18:00:47.705 xctest[31397:828869] (dlopen_preflight(/Users/Hami/Library/Developer/Xcode/DerivedData/PusherSwift-cifrlthdfybbcedmlylirqthvkky/Build/Products/Debug/PusherSwiftTests.xctest/Contents/MacOS/PusherSwiftTests): Library not loaded: @rpath/Nimble.framework/Versions/A/Nimble
  Referenced from: /Users/Hami/Library/Developer/Xcode/DerivedData/PusherSwift-cifrlthdfybbcedmlylirqthvkky/Build/Products/Debug/PusherSwiftTests.xctest/Contents/MacOS/PusherSwiftTests
  Reason: image not found)
Program ended with exit code: 82

I've seen https://github.com/Quick/Nimble/issues/41 and https://github.com/Quick/Nimble/issues/128 and checked other projects that have similar issues and none of the solutions seem to work.

I'm using Cocoapods and have both Nimble and Quick as part of the podfile.

Note that for the iOS and tvOS targets, this works fine, but for the OSX one it doesn't.

Thanks!

Most helpful comment

This issue was resolved for me once I followed the fourth step of the Carthage installation instructions correctly (seems I missed this one earlier, or it was added later on):

On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:

/usr/local/bin/carthage copy-frameworks

and add the paths to the frameworks you want to use under “Input Files”, e.g.:

$(SRCROOT)/Carthage/Build/iOS/Box.framework
$(SRCROOT)/Carthage/Build/iOS/Result.framework
$(SRCROOT)/Carthage/Build/iOS/ReactiveCocoa.framework

Additionally for my test targets I followed this here, too:

In rare cases, you may want to also copy each dependency into the build product (e.g., to embed dependencies within the outer framework, or make sure dependencies are present in a test bundle). To do this, create a new “Copy Files” build phase with the “Frameworks” destination, then add the framework reference there as well.

Maybe this helps others experiencing the same issue. It actually doesn't seem to be a problem with this project so this can be closed, I think. Sorry for making you reopen.

All 7 comments

Having deleted everything in DerivedData the problem remains but with a different library mentioned in the error:

2016-01-12 11:31:11.685 xctest[37278:1011889] The bundle “PusherSwiftTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-01-12 11:31:11.686 xctest[37278:1011889] (dlopen_preflight(/Users/Hami/Library/Developer/Xcode/DerivedData/PusherSwift-cifrlthdfybbcedmlylirqthvkky/Build/Products/Debug/PusherSwiftTests.xctest/Contents/MacOS/PusherSwiftTests): Library not loaded: @rpath/CryptoSwift.framework/Versions/A/CryptoSwift
  Referenced from: /Users/Hami/Library/Developer/Xcode/DerivedData/PusherSwift-cifrlthdfybbcedmlylirqthvkky/Build/Products/Debug/PusherSwiftTests.xctest/Contents/MacOS/PusherSwiftTests
  Reason: image not found)
Program ended with exit code: 82

So I'm not sure if this is to do with Nimble at all...?

Closing for now as I think this is more to do with Cocoapods. See issue there: https://github.com/CocoaPods/CocoaPods/issues/4752

I'm experiencing this same issue with Nimble although I integrated it with Carthage (alongside Quick) – so could we please reopen until the situation is clarified? Also any ideas are welcome. I already cleaned derived data, reset iOS simulator etc. – didn't help for now.

This issue was resolved for me once I followed the fourth step of the Carthage installation instructions correctly (seems I missed this one earlier, or it was added later on):

On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:

/usr/local/bin/carthage copy-frameworks

and add the paths to the frameworks you want to use under “Input Files”, e.g.:

$(SRCROOT)/Carthage/Build/iOS/Box.framework
$(SRCROOT)/Carthage/Build/iOS/Result.framework
$(SRCROOT)/Carthage/Build/iOS/ReactiveCocoa.framework

Additionally for my test targets I followed this here, too:

In rare cases, you may want to also copy each dependency into the build product (e.g., to embed dependencies within the outer framework, or make sure dependencies are present in a test bundle). To do this, create a new “Copy Files” build phase with the “Frameworks” destination, then add the framework reference there as well.

Maybe this helps others experiencing the same issue. It actually doesn't seem to be a problem with this project so this can be closed, I think. Sorry for making you reopen.

Thanks for following up @Dschee. Closing.

@Dschee constantly forgetting this…

If you are including Quick please note
Your Test Target Must Include At Least One Swift File
Ref

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pavel-primachek picture pavel-primachek  Â·  3Comments

sreddy100 picture sreddy100  Â·  4Comments

msaehn picture msaehn  Â·  5Comments

danielsaidi picture danielsaidi  Â·  10Comments

Blackjacx picture Blackjacx  Â·  7Comments