3

I have just updated my Xcode to version 5.0.2 And after updating, all my previously running apps (*perfectly running and archiving) are now giving following errors when I try to archive them for testing on my devices (not connected devices).

Ld /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test normal armv7s
    cd /Users/dharammalik/Documents/PhonegapWorkspace/lite_test
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.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 armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos -F/Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos -filelist /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -all_load -Obj-C -fobjc-link-runtime -miphoneos-version-min=5.0 -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos/libCordova.a -framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -weak_framework CoreMedia -framework CoreLocation -Xlinker -dependency_info -Xlinker /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test_dependency_info.dat -o /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/IntermediateBuildFilesPath/lite_test.build/Release-iphoneos/lite_test.build/Objects-normal/armv7s/lite_test

ld: warning: ignoring file /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (armv7s): /Users/dharammalik/Library/Developer/Xcode/DerivedData/lite_test-hblolzuqyvugvdfpenjeoxvmovrk/Build/Intermediates/ArchiveIntermediates/lite_test/BuildProductsPath/Release-iphoneos/libCordova.a
Undefined symbols for architecture armv7s:
  "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
  "_CDVLocalNotification", referenced from:
      -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
  "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVCommandQueue", referenced from:
      _OBJC_CLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
      _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
  "_CDVPluginHandleOpenURLNotification", referenced from:
      -[AppDelegate application:handleOpenURL:] in AppDelegate.o
  "_OBJC_CLASS_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Tried changing the Architectures, but nothing worked. Any idea how to resolve these issues? They were not there at all in the previous version of Xcode I had.

vcsjones
  • 138,677
  • 31
  • 291
  • 286
Sana
  • 319
  • 1
  • 3
  • 18

5 Answers5

9

Remove armv7s from valid architectures section and it will work.

Build Settings --> Architectures --> Valid Architectures

enter image description here

Harikrishnan
  • 9,688
  • 11
  • 84
  • 127
  • 1
    what are the effects of doing this? Does this mean the app won't run in the new iPad Airs? Is this going to get me rejected from the App Store review? – Rob Mar 17 '14 at 20:34
  • I posted this answer after confirmation..You can refer my question http://stackoverflow.com/q/13815601/1740715 – Harikrishnan Mar 18 '14 at 02:18
  • I dont have valid architectures as an option? – Abe Petrillo Mar 24 '14 at 20:59
  • @AbePetrillo 1)Click on Project name with blue icon from left Panel (A tree like arrangement). 2)Select build settings tab 3)There will be small search box where you can search for 'valid' and 'Valid Architectures' will appear – Harikrishnan Mar 27 '14 at 05:39
  • 1
    @AbePetrillo In the top left area of the "Build Settings" panel, select "All" instead of "Basic". – rjhilgefort Mar 27 '14 at 15:22
3

Change the Buid setting ---> Architecture ---> Build Active Architecture only ---> Yes This solved my issue for using old cordova versions in new Xcode 5

smartkid
  • 71
  • 2
2

I had the same problem and the issue was that I have accidently imported a .m file instead of .h in an implementation file - hope it helps

Abhiram
  • 247
  • 2
  • 14
0
libCordova.a, file was built for archive which is not the architecture being linked (armv7s)

Looks like your copy of libCordova framework does not contain a armv7s binary.

ahwulf
  • 2,584
  • 15
  • 29
  • What could be the solution ? – Sana Nov 20 '13 at 05:25
  • Change the architectures to only armv7 only. Or you can recompile (does Cordova have source?) Cordova to include armv7s. Since you are building armv7 and armv7s it expects all libs/frameworks to contain both architectures. You don't need armv7s anyway unless you need one of the few addition instructions in the armv7s processor which is rare. – ahwulf Nov 20 '13 at 09:24
0

You need to change the Architectures in the CordovaLib project, not in your lite_test project. I assume when you said you tried changing the Architectures, you only tried in your project and not the Cordova project (since changing in Cordova worked for me) . Remember that Cordova is a dependent project and is compiled into the binary each time you run.

Uncharted Space
  • 861
  • 7
  • 13
  • Can you please tell me the detailed steps that I should follow to remove these error – Sana Nov 20 '13 at 05:24