Quick: Library not loaded: @rpath/Quick.framework/Quick / @rpath/Nimble.framework/Nimble

Created on 22 Oct 2014  Â·  15Comments  Â·  Source: Quick/Quick

Current installation instructions does not provide all information required for a comfortable use of Quick & Nimble. Running of unit tests from command line with Quick / Nimble as dependency without prior compilation of frameworks will cause error with text "Library not loaded: @rpath/Quick.framework/Quick".
Issue is actual for Quick users https://github.com/facebook/xctool/issues/415 now. Similar issue was recently actual for Alamofire users https://github.com/Alamofire/Alamofire/issues/101
issue was fixed as result following string appeared in documentation (https://github.com/Alamofire/Alamofire):

  • Expand the "Target Dependencies" group, and add Alamofire.framework.
  • Click on the + button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add Alamofire.framework.

Similar additions for Nimble & Quick installation instructions need to be add.

Most helpful comment

Leaving here as an FYI: In Objective-C, this can also be caused by not having a .swift file in your test target. For more information, read: https://github.com/Quick/Quick/blob/master/Documentation/en-us/QuickInObjectiveC.md#your-test-target-must-include-at-least-one-swift-file

All 15 comments

@nikita-leonov Thanks for the heads up, but are you sure? I just followed the README instructions exactly for a brand new iOS project, linking Quick-iOS and Nimble-iOS. It worked flawlessly.

Can you describe the exact steps you followed to get the error messages you describe.

Not sure that it will help, as I am using xctool, but I believe the same will be reproducible with xcodebuild as well:
xctool test -workspace app.xcworkspace -scheme app -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO

I will check with xcodebuild tomorrow and will provide a sample to reproduce an issue.

Running of unit tests from command line

Whoops, sorry, I didn't see this part. I double-checked and the following works:

xcodebuild -project YourProject.xcodeproj -scheme YourProject -sdk iphonesimulator test

Haven't tried with xctool yet, but let me know if you can confirm the issue in the meantime! :+1:

Quick question: are you testing on a physical device? We're seeing similar error messages in #140. Testing on physical devices isn't currently supported.

We testing our product on simulator, not on physical device. All our tests are written in swift and run by xctool. I still owe you sample project, but looks like I was too fast to promise it today, I would say on this week :)

xctool wasn't building properly until recently (like the past few days). Could you try pulling in the latest master.

—
Sent from my iPhone

On Wed, Oct 22, 2014 at 6:59 PM, Nikita Leonov [email protected]
wrote:

We testing our product on simulator, not on physical device. All our tests are written in swift and run by xctool. I still owe you sample project, but looks like I was too fast to promise it today, I would say on this week :)

Reply to this email directly or view it on GitHub:
https://github.com/Quick/Quick/issues/159#issuecomment-60182914

@jeffh you are right. I tested with brew install xctool --HEAD and it works properly with a currently provided instructions. It does not work with latest stable release of xctool and require instruction as in AlamoFire that I referenced above, but it is not Quick/Nimble issue so far it is xctool issue. Thanks!

/cc @ExtremeMan :question: :speak_no_evil:

I'm actually having a similar problem. I ran through the initial steps as described in the tutorial. However, I get the following error when trying to build my test framework (even after individually building Nimble):

2014-11-14 01:54:53.991 Hacker News[6752:1312142] Error loading /private/var/mobile/Containers/Data/Application/28466EDA-DF50-4292-BE47-3518428355C6/tmp/HackerNewsTests.xctest/HackerNewsTests:  dlopen(/private/var/mobile/Containers/Data/Application/28466EDA-DF50-4292-BE47-3518428355C6/tmp/HackerNewsTests.xctest/HackerNewsTests, 262): Library not loaded: @rpath/Nimble.framework/Nimble
  Referenced from: /private/var/mobile/Containers/Data/Application/28466EDA-DF50-4292-BE47-3518428355C6/tmp/HackerNewsTests.xctest/HackerNewsTests
  Reason: image not found

Usually, I just solve this problem by removing and adding the framework from the Link with Binary phase, but that doesn't seem to work either.

My project is at:
https://github.com/wrkstrm/HelveticaNeue/tree/Quickly

@rismay Could you please add instructions on how to build your project? I'd like to try running it myself, but I'm encountering several build errors.

Here's what I'm doing:

$ git clone [email protected]:wrkstrm/HelveticaNeue.git
$ cd HelveticaNeue
$ git checkout Quickly
$ git submodule update --init --recursive
$ open HackerNews.xcworkspace

Building the HackerNews scheme results in the following error:

/Users/modocache/GitHub/tmp/HelveticaNeue/HackerNews/HackerNews-Bridging-Header.h:14:9: error: 'CouchbaseLite/CouchbaseLite.h' file not found
#import <CouchbaseLite/CouchbaseLite.h>
        ^
<unknown>:0: error: failed to import bridging header '/Users/modocache/GitHub/tmp/HelveticaNeue/HackerNews/HackerNews-Bridging-Header.h'

I thought that maybe I should run pod install, since I notice you're using CocoaPods:

$ pod install

But the error remained. :cry:

Also, quick question: how are you building the project? Via Xcode? The command line? Using xcodebuild, or xctool?

Thanks for taking a look.
It was a .gitignore issue. I've fixed it and pushed the latest change to the Quickly branch. Running the same commands again should get you a working build.
When I run in the simulator, testing stalls.
However, when I run on a device I get the warning I posted before.

@rismay Thanks for the update!

After pulling your latest updates, I performed the commands I listed above. After doing so, the tests run without issue from Xcode (using ⌘+U):

2014-11-14 16:12:19.936 Hacker News[22159:187870] Flurry: Starting session on Agent Version [Flurry_iOS_140_5.4.0] 
Test Suite 'All tests' started at 2014-11-15 00:12:20 +0000
Test Suite 'HackerNewsTests.xctest' started at 2014-11-15 00:12:20 +0000
Test Suite 'TopViewControllerTests' started at 2014-11-15 00:12:20 +0000
Test Case '-[HackerNews.TopViewControllerTests tableview_udpate__works_fine]' started.
Test Case '-[HackerNews.TopViewControllerTests tableview_udpate__works_fine]' passed (0.006 seconds).
Test Suite 'TopViewControllerTests' passed at 2014-11-15 00:12:20 +0000.
     Executed 1 test, with 0 failures (0 unexpected) in 0.006 (0.006) seconds
Test Suite 'HackerNewsTests' started at 2014-11-15 00:12:20 +0000
Test Case '-[HackerNewsTests testExample]' started.
Test Case '-[HackerNewsTests testExample]' passed (0.000 seconds).
Test Case '-[HackerNewsTests testPerformanceExample]' started.
/Users/bgesiak/GitHub/tmp/HelveticaNeue/HackerNewsTests/HackerNewsTests.m:39: Test Case '-[HackerNewsTests testPerformanceExample]' measured [Time, seconds] average: 0.000, relative standard deviation: 135.702%, values: [0.000003, 0.000001, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[HackerNewsTests testPerformanceExample]' passed (0.341 seconds).
Test Suite 'HackerNewsTests' passed at 2014-11-15 00:12:20 +0000.
     Executed 2 tests, with 0 failures (0 unexpected) in 0.341 (0.342) seconds
Test Suite 'HackerNewsTests.xctest' passed at 2014-11-15 00:12:20 +0000.
     Executed 3 tests, with 0 failures (0 unexpected) in 0.347 (0.349) seconds
Test Suite 'Quick.framework' started at 2014-11-15 00:12:20 +0000
Test Suite 'Quick.framework' passed at 2014-11-15 00:12:20 +0000.
     Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'All tests' passed at 2014-11-15 00:12:20 +0000.
     Executed 3 tests, with 0 failures (0 unexpected) in 0.347 (0.352) seconds

Note the Test Case '-[HackerNews.TopViewControllerTests tableview_udpate__works_fine]' passed (0.006 seconds) output in the example above, which I think is a pretty good indication that everything is working.

I also tried enabling building from the command line (by checking "Shared"):

screen shot 2014-11-14 at 4 15 29 pm

After doing so, testing from the command line also succeeds:

$ xcodebuild -workspace HackerNews.xcworkspace -scheme HackerNews -sdk iphonesimulator clean test

I haven't tried testing on a physical device--Quick doesn't support testing on devices yet; issue #149 is tracking progress on that front.

But I'm pretty sure there's nothing wrong with Quick itself here. Can you confirm so I can close this issue?

I can also confirm! I think it was an Xcode issue. As I mentioned above I tried running from the Simulator, but I didn't see that output. From here on I'll track issue #149.

Awesome! Thanks for the heads up, @rismay, feel free to open another issue if you encounter any problems. :cocktail:

Leaving here as an FYI: In Objective-C, this can also be caused by not having a .swift file in your test target. For more information, read: https://github.com/Quick/Quick/blob/master/Documentation/en-us/QuickInObjectiveC.md#your-test-target-must-include-at-least-one-swift-file

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pedrovereza picture pedrovereza  Â·  14Comments

ratkins picture ratkins  Â·  15Comments

zbeckman picture zbeckman  Â·  42Comments

noisypigeon picture noisypigeon  Â·  17Comments

ondev picture ondev  Â·  14Comments