I have an iOS component which relies on the Stripe iOS SDK, Project A. I included the Stripe SDK in Project A in Xcode and it compiles fine.
However, I\'m building
Noticed this problem while switching some dependencies from pods to carthage. Similar to Honey's answer, I was able to get around this error modifying the podfile.
Turns out all I had to add was the test target. Then run 'pod install', and it will link your test target to your the frameworks generated by your pods.
target 'Project' do
use_frameworks!
//pods here normally
target 'ProjectTests' do
//nothing in here
end
end
I had to do two things to get this working:
Add "$(SRCROOT)/../.." (since Project B lives two folders deep inside Project A) to "Framework Search Paths" under Build Settings -> "Search Paths" for the Project B target.
Add the Stripe SDK to Project B's frameworks as well. This second step in particular surprised me because Project B does not rely directly upon Stripe.
I was seeing this same issue with another framework while running my test target. I had to add the framework to my test target (not only my normal target) under Build Phases > Link Binary With Libraries
section.
Carthage has more info about the issue I saw: https://github.com/carthage/carthage#adding-frameworks-to-unit-tests-or-a-framework
So this is how my podfile looks like:
def shared_pods
pod ‘GoogleMaps', '~> 1.13.0'
pod ‘SwiftyJSON', '~> 2.3.2'
pod ‘Alamofire', '~> 3.2.1'
pod ‘MGSwipeTableCell’
end
target 'projectName' do
shared_pods
end
So then I added this to podfile:
target ‘ProjectTests’ do
pod ‘Nimble’, ‘~> 4.0.0’
pod ’Quick’
end
What I also needed to do was:
target ‘ProjectTests’ do
shared_pods // I needed to add this line as well. Since this line included the needed 'MGSwipeTableCell' framework
pod ‘Nimble’, ‘~> 4.0.0’
pod ’Quick’
end
So a possible reason would be that in your podfile you didn't add them correctly, just be sure that the framework is added into the necessary targets.