Sam Valens
Sam Valens

Reputation: 431

Xcode - SenTestingKit not found

I have an issue that popped up when I upgraded my version of xcode. I use unit tests, and I now when I try to import SenTestingKit (#import <SenTestingKit/SenTestingKit.h>), I get this error: SenTestingKit/SenTestingKit.h: No such file or directory.

I have looked at my build settings, and I have the following configuration options:

== Linking ==
Other Linker Flags: -framework Foundation -framework SenTestingKit -framework UIKit
Prebinding: No

== Search Paths ==
Debug Configutation: "/iphonesimulator4.0/Developer/Library/Frameworks" "/Xcode4/Library/Frameworks"

I've checked /Xcode4/Library/Frameworks, and the SenTestingKit.framework/ directory is there.

So what am I missing?

Upvotes: 41

Views: 27334

Answers (6)

valexa
valexa

Reputation: 4503

To clear this up once for all, there are three SenTestingKit frameworks in Xcode SDK, one is for OS X, one is for iOS and one is for the simulator.

Had you ran "lipo -info" on them you would have seen that

Architectures in the fat file: /Developer/Library/Frameworks/SenTestingKit.framework/Versions/A/SenTestingKit are: x86_64 i386

Architectures in the fat file: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit is architecture: armv7

Non-fat file: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit is architecture: i386

Upvotes: 1

DougW
DougW

Reputation: 30045

I had this issue after upgrading to xcode 4.3. Nothing seemed to work until I came across this post. I already had the same search paths, but changing the order solved the issue.

So from the article, you need the two following values in your Framework Search Paths, in this order.

$(SDKROOT)/Developer/Library/Frameworks
$(DEVELOPER_LIBRARY_DIR)/Frameworks

Upvotes: 18

Christopher Pickslay
Christopher Pickslay

Reputation: 17772

I had this issue because there's a space in my Xcode installation: /Xcode 4.0.2

I fixed it by adding "${DEVELOPER_LIBRARY_DIR}/Frameworks" (with the quotes) to my Framework Search Paths.

Upvotes: 6

davidwu
davidwu

Reputation: 619

I had this same issue when creating a new test case in XCode. However, this was due to stupidity of me selecting the wrong target when creating the test case.

Using "File New...", the test case was being included and compiled with the target application settings instead of test case's target. Checking the Build Phases tab and looking in the "Compile Sources" disclosure revealed my particular issue.

Upvotes: 57

Stuart Carnie
Stuart Carnie

Reputation: 5476

For my Framework Search Paths, I've explicitly added /$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk/Developer/Library/Frameworks. Compiles correctly for simulator and device.

I am sure there are environment variables so that it works across SDK versions, so I will update answer if I find them.

screenshot

Upvotes: 1

Daniel Farrell
Daniel Farrell

Reputation: 9750

You might want to check that Xcode is checking the Framework Search Paths: Framework Search Paths

Upvotes: 0

Related Questions