5

To start, i looked at all the other search topics and none applied or didn't work. For example, i have a hard time that apple didn't make xctest compatible with all architectures.

On a Xcode project for work i randomly started getting the following build error on linking:

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)

All this while trying to build my application target and NOT my test target. Some further notes:

  • I am NOT linking against XCTest in my build settings for the application target
  • I am building, not testing this specific target
  • I do have in both my build settings -> Architectures|Valid Architectures "Standard Architectures (armv7, armv7s).
  • This only happens when i build for a iOS device and not a simulator...i think this is because building for a simulator only tries the i386 architecture?

To be honest, i have no idea why the linker is even trying to link against XCTest in this case...i even modified the scheme to remove all tests though i wasn't trying to test against the target.

Please feel free to ask me any other questions.

Ethan Allen
  • 255
  • 4
  • 8
  • See my answer to a similar question [Answer to XCText missing required architecture armv7 ][1] [1]: http://stackoverflow.com/a/23704351/285659 – ribeto May 16 '14 at 20:55

5 Answers5

11

You may have the same simple but frustrating problem as I had. It's a scheme setting: Click on your project scheme in the toolbar (right of the play/stop buttons), and select 'Edit' from the popup. Under the 'Build' item on the left, make sure your test targets only have 'Test' checked.

emp
  • 3,350
  • 1
  • 22
  • 19
1

Please make sure the Build Setting of "build Active Architecture only" is set to NO, maybe it's the cause of this problem.

marter0574
  • 11
  • 1
0

Turns out that buried deep in the compile sources for the application target i had a file that included imports for XCTest stuff...removing this immediately made this go away.

So answer being verify that you do not have anything in your compile sources list that may reference a library you didn't intend

Ethan Allen
  • 255
  • 4
  • 8
0

I just had the same issue after including a third-party project. When selecting the target I chose the main project target (not the test target), but the included project had a sub-target which were unit tests. Xcode helpfully added those to my main application target. After changing the target setting for the relevant file it worked alright.

Oliver Mason
  • 2,240
  • 2
  • 15
  • 23
0

It happens that after adding $(PLATFORM_DIR)/Developer/Library/Frameworks as a first item in <Target>/<Build Settings>/<Search Paths>/<Framework Search Paths> I got rid of nasty "ld: framework not found XCTest for architecture arm64" link error by using XCode 6.3.1.

vedrano
  • 2,961
  • 1
  • 28
  • 25