Carthage: Error running unit tests. Can't find Frameworks for Target Dependencies

Created on 24 Jul 2015  Â·  5Comments  Â·  Source: Carthage/Carthage

I'm getting this error on running my unit tests for a Static Library project.

Library not loaded: @rpath/ReactiveCocoa.framework/ReactiveCocoa
  Referenced from: /Users/wesr/Library/Developer/Xcode/DerivedData/SpatialConnect-flewyfsgpffsjvgrrmjgyezsyujb/Build/Products/Debug-iphonesimulator/SpatialConnectTests.xctest/SpatialConnectTests
  Reason: image not found, NSBundlePath=/Users/wesr/Library/Developer/Xcode/DerivedData/SpatialConnect-flewyfsgpffsjvgrrmjgyezsyujb/Build/Products/Debug-iphonesimulator/SpatialConnectTests.xctest, NSLocalizedDescription=The bundle “SpatialConnectTests” couldn’t be loaded because it is damaged or missing necessary resources.}

I have ReactiveCocoa linked in the Unit Tests but since there is no Embed Frameworks option for static libraries, I'm at a loss.

if I copy Frameworks, I get preprocessor errors
screen shot 2015-07-24 at 8 28 49 am

Most helpful comment

The solution is in the main docs: https://github.com/Carthage/Carthage#adding-frameworks-to-unit-tests-or-a-framework

All 5 comments

This isn't really a Carthage issue—it's just an issue with using a framework in the unit test bundle for a static library. Unfortunately, I'm not sure what the solution is here.

@mdiep I agree this isn't a Carthage issue but I think its a use of Carthage issue. I followed the setup instructions and its still not working.
Do you know of any examples or others using this?

I agree this isn't a Carthage issue but I think its a use of Carthage issue

Yup, I agree. Sorry if I came across as dismissive!

I think it would probably work if you changed your static library to a dynamic framework. The underlying problem is that XCTest isn't loading ReactiveCocoa from the unit test bundle. You might try looking at the unit test target of a dynamic framework to see how the unit test bundle is configured to find the dependent frameworks.

I ran through this tutorial and it worked. I thought I had done all this before but maybe something was missed.

The solution is in the main docs: https://github.com/Carthage/Carthage#adding-frameworks-to-unit-tests-or-a-framework

Was this page helpful?
0 / 5 - 0 ratings