Xcode - SenTestingKit not found

2019-01-17 05:31发布

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?

6条回答
三岁会撩人
2楼-- · 2019-01-17 06:10

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

查看更多
一夜七次
3楼-- · 2019-01-17 06:11

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
查看更多
我只想做你的唯一
4楼-- · 2019-01-17 06:11

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.

查看更多
Juvenile、少年°
5楼-- · 2019-01-17 06:15

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.

查看更多
一纸荒年 Trace。
6楼-- · 2019-01-17 06:19

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

查看更多
你好瞎i
7楼-- · 2019-01-17 06:26

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

查看更多
登录 后发表回答