ios - 在构建应用程序目标的文件 XCTest 中缺少所需的体系结构 armv7

标签 ios objective-c xcode

首先,我查看了所有其他搜索主题,但没有一个适用或无效。例如,苹果没有让 xctest 与所有架构兼容,我很难过。

在工作的 Xcode 项目上,我随机开始在链接时收到以下构建错误:

Ld /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience normal armv7
cd /Users/eallen/tmdev/ios/mive
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Products/Debug-iphoneos -L/Users/eallen/tmdev/ios/mive -L/Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates -F/Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Products/Debug-iphoneos -FFrameworks -FPods/Pixate/Framework/iOS -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/Developer/Library/Frameworks -filelist /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience.LinkFileList -dead_strip -ObjC -lObjC -lxml2 -framework CoreGraphics -framework CoreText -framework MobileCoreServices -framework Pixate -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -fprofile-arcs -ftest-coverage -miphoneos-version-min=7.0 -lPods -framework QuartzCore -framework CoreText -framework CoreGraphics -framework CoreData -framework UIKit -framework Foundation -framework Crashlytics -Xlinker -dependency_info -Xlinker /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience_dependency_info.dat -o /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience

ld: in '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest', missing required architecture armv7 in file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest (2 slices) for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

所有这些都是在尝试构建我的应用程序目标而不是我的测试目标时进行的。一些进一步的说明:

  • 我没有在我的应用程序目标build设置中链接到 XCTest
  • 我正在构建,而不是测试这个特定目标
  • 我的两个build设置中都有 -> Architectures|Valid Architectures“Standard Architectures (armv7, armv7s)”。
  • 只有当我为 iOS 设备而非模拟器构建时才会发生这种情况...我认为这是因为为模拟器构建仅尝试 i386 架构?

老实说,我不知道为什么在这种情况下链接器甚至会尝试链接到 XCTest...我什至修改了方案以删除所有测试,尽管我并没有尝试针对目标进行测试。

如有任何其他问题,请随时问我。

最佳答案

您可能遇到了和我一样简单但令人沮丧的问题。这是一个方案设置: 单击工具栏中的项目方案(播放/停止按钮右侧),然后从弹出窗口中选择“编辑”。在左侧的“构建”项下,确保您的测试目标仅选中“测试”。

关于ios - 在构建应用程序目标的文件 XCTest 中缺少所需的体系结构 armv7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20546914/

相关文章:

iphone - 尝试在 iOS 上使用 Restkit - XCode

ios - UIView的居中坐标原点

iphone - 找不到 -lxml2 的库 仅当在设备而非模拟器上运行时

c - 当出现 "multidigit number with all digits identical"时,如何让我的程序执行任何操作?

ios - 报亭安装留下阴影 "installing"图标

ios - append 字典,iOS,Swift

iphone - 文件名中的编码信息 (iPhone/mac)

iphone - 在导航栏iPhone上设置自定义后退按钮,有时会在顶部显示后退按钮

iphone - UIButton 图像不会在 "for"循环中更改

iOS force landscape in one viewController