【问题标题】:missing required architecture armv7 in file XCTest on building application target在构建应用程序目标的文件 XCTest 中缺少所需的架构 armv7
【发布时间】:2013-12-12 15:01:33
【问题描述】:

首先,我查看了所有其他搜索主题,但没有一个应用或不起作用。例如,苹果没有让 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)

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

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

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

请随时问我任何其他问题。

【问题讨论】:

标签: ios objective-c xcode


【解决方案1】:

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

【讨论】:

  • 谢谢!我必须创建一个新的测试目标,Xcode 为所有内容配置了它,这对我来说是正确的解决方法。
【解决方案2】:

请确保“仅构建活动架构”的构建设置设置为否,可能是导致此问题的原因。

【讨论】:

    【解决方案3】:

    原来深埋在应用程序目标的编译源中,我有一个文件,其中包含 XCTest 东西的导入...立即删除它会使它消失。

    所以回答是验证你的编译源列表中没有任何可能引用你不想要的库的东西

    【讨论】:

      【解决方案4】:

      在包含第三方项目后,我也遇到了同样的问题。选择目标时,我选择了主项目目标(不是测试目标),但包含的项目有一个子目标,它是单元测试。 Xcode 有助于将这些添加到我的主要应用程序目标中。更改相关文件的目标设置后,它工作正常。

      【讨论】:

        【解决方案5】:

        碰巧在<Target>/<Build Settings>/<Search Paths>/<Framework Search Paths> 中添加$(PLATFORM_DIR)/Developer/Library/Frameworks 作为第一项后,我使用XCode 6.3.1 摆脱了讨厌的“ld: framework not found XCTest for architecture arm64”链接错误。

        【讨论】:

          猜你喜欢
          • 2012-05-08
          • 2012-04-03
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-10-26
          • 2015-10-10
          相关资源
          最近更新 更多