XCTest.framework建立自己的错误 [英] XCTest.framework build error

查看:456
本文介绍了XCTest.framework建立自己的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Dropbox的核心API在我的应用程序,因此,我必须包括XCTest框架,因为当我还没有加入XCTest框架,我的应用程序无法连接到Dropbox的,但是当我做添加框架,我得到一个错误,而建设的模拟器。有什么错我的code!以下是错误:

I am using the DropBox Core API in my app and therefore, I must include the XCTest framework, because, when I haven't added the XCTest framework, my app can't connect to dropbox, however when I do add the framework, I get an error while building for the simulator. There is nothing wrong with my code! Here is the error:

Ld /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop!-fchnxyvnqyeefscfhmohrzxtiqeb/Build/Products/Debug-iphonesimulator/SnapDrop!.app/SnapDrop! normal i386
    cd "/Users/Zach/Desktop/SnapDrop!"
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
    setenv PATH "/Applications/Xcode5-DP6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode5-DP6.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode5-DP6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode5-DP6.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop!-fchnxyvnqyeefscfhmohrzxtiqeb/Build/Products/Debug-iphonesimulator -F/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop!-fchnxyvnqyeefscfhmohrzxtiqeb/Build/Products/Debug-iphonesimulator -F/Users/Zach/Downloads/dropbox-ios-sdk-1.3.5 -F/Users/Zach/Downloads/dropbox-ios-sync-sdk-1-1.1.0 -F/Applications/Xcode5-DP6.app/Contents/Developer/Library/Frameworks -F/Users/Zach/Desktop -filelist /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop!-fchnxyvnqyeefscfhmohrzxtiqeb/Build/Intermediates/SnapDrop!.build/Debug-iphonesimulator/SnapDrop!.build/Objects-normal/i386/SnapDrop!.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework iAd -framework AssetsLibrary -framework QuartzCore -framework SystemConfiguration -framework Security -framework CFNetwork -framework XCTest -framework Dropbox -framework DropboxSDK -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop!-fchnxyvnqyeefscfhmohrzxtiqeb/Build/Intermediates/SnapDrop!.build/Debug-iphonesimulator/SnapDrop!.build/Objects-normal/i386/SnapDrop!_dependency_info.dat -o /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop!-fchnxyvnqyeefscfhmohrzxtiqeb/Build/Products/Debug-iphonesimulator/SnapDrop!.app/SnapDrop!

ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode5-DP6.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我应该怎么办?如果我的框架是贪官,你能告诉我如何重新安装呢?我试图删除并重新安装X code。与没有运气。

What should I do? If my framework is corrupt, can you tell me how to reinstall it? I have tried deleting and reinstalling Xcode with no luck.

推荐答案

我同意迈克·韦勒。你可能不应该链接针对您的实际应用code中的XCTest框架。删除XCTest框架。看链接错误和删除的东西,所引用的框架。洗,漂洗,重复。

I agree with Mike Weller. You should probably not be linking against the XCTest framework in your actual app code. Remove XCTest framework. Look at the linker errors and remove things that are referencing the framework. Wash, rinse, repeat.

如果你有一个测试的目标,这是不同的。可以从SenTestKit到XCTest在迁移过程中易发生的是一种具有抗导致Mac OS X的框架,而不是iOS的框架将错误框架搜索路径。这是行不通的。

If you have a test target, that is different. What can easily happen during the migration from SenTestKit to XCTest is having the wrong framework search path which causes linking against the Mac OS X framework instead of the iOS framework. This doesn't work.

一个简单的方法才能看到正确的框架搜索路径设置是什么是创建一个虚拟项目中,打开生成设置为测试目标,然后筛选框架搜索路径。

An easy way to see what the correct framework search path settings are is to create a dummy project, open the build settings for the Tests target and then filter for "Framework Search Path."

我认为正确的香草路径是:

I think the correct vanilla paths are:

$(SDKROOT)/Developer/Library/Frameworks     (non-recursive)
$(inherited)                                (non-recursive)
$(DEVELOPER_FRAMEWORKS_DIR)                 (non-recursive)

这篇关于XCTest.framework建立自己的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆