5

I have an Xcode workspace in which I have updated to KIF 2.0(pod update via terminal & pod 'KIF' in the podfile) after that I have configured the workspace as per the instructions provided in https://github.com/kif-framework/KIF#configure-the-testing-target(installation with Cocoapods section).But when I tried to execute the project as well as Run my test target it throws an error,

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

I have also checked this link:https://groups.google.com/forum/#!msg/kif-framework/EilvCp2psZA/huUQ3sGpmwQJ . But still the issue persists.

How can I correct it? The screen shot is provided below.enter image description here

When I tried to Run it using iPhone 5 it shows 5 linker error such as

ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit, missing required architecture armv7s in file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit (2 slices)
Undefined symbols for architecture armv7s:
  "_OBJC_METACLASS_$_SenTestCase", referenced from:
      _OBJC_METACLASS_$_KIFTestCase in libPods.a(KIFTestCase.o)
  "_OBJC_CLASS_$_SenTestCase", referenced from:
      _OBJC_CLASS_$_KIFTestCase in libPods.a(KIFTestCase.o)
      l_OBJC_$_CATEGORY_SenTestCase_$_KIFAdditions in libPods.a(SenTestCase-KIFAdditions.o)
  "_SenTestToolKey", referenced from:
      +[KIFTestActor load] in libPods.a(KIFTestActor.o)
  "_SenSelfTestMain", referenced from:
      +[KIFTestActor load] in libPods.a(KIFTestActor.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

Tirth
  • 7,801
  • 9
  • 55
  • 88
Hari
  • 123
  • 1
  • 12

4 Answers4

3

Same issue here with the latest cocoa pods version.

You can solve this by following this steps:

  • Select the Pods project
  • Click on build settings
  • Change Build Active Architecture Only to 'No'
NSMutableString
  • 10,493
  • 1
  • 21
  • 27
  • I have done the same thing you mentioned.But it still shows the same isssues.I have restarted the Xcode 5 and tried to Run it again.But the issue persists.:( – Hari Nov 05 '13 at 11:03
  • In my projects for all targets, build_activ_arch_only debug section is set as Yes. – Hari Nov 05 '13 at 11:05
  • Strange, are you sure you set the key of the Pods project and not your Nexercise_iPhone project? – NSMutableString Nov 05 '13 at 11:50
  • Yes.I have set the Nexercise_iPhone project build_active_arch_only as No and pods project as Yes. – Hari Nov 05 '13 at 12:05
  • You should change the Build Active Architecture Only from the Pods project to 'No' instead of 'Yes' – NSMutableString Nov 05 '13 at 12:36
  • I did the same but still error persists..I am trying to resolve this for the past 2 days... – Hari Nov 05 '13 at 12:46
  • Sorry, out of inspiration, this workaround did the trick for me. – NSMutableString Nov 05 '13 at 12:56
  • I have posted the issue on github : https://github.com/kif-framework/KIF/issues/288 but no reply has came upto yet. – Hari Nov 05 '13 at 13:01
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/40563/discussion-between-user1884775-and-nsmutablestring) – Hari Nov 05 '13 at 13:15
  • This works for me. After I set Build Active Architecture Only to 'NO' for pod project, the errors are gone. – Emmy May 09 '14 at 06:07
  • i had to work hours to get it working ... but finally setting Build Active Architecture Only to YES worked for me !!! – Bishal Ghimire Jul 15 '14 at 07:34
2

Go to your target settings and add SenTestingKit to Link binary with libraries.

  • Adding the SenTestingKit framework to the libraries does not make any difference.. :( – Hari Nov 05 '13 at 10:52
  • Alright, so then go to Configurations under Info Tab on your project Target, disclose Debug config and then select the KIF Bundle Test Target and point it to right KIF pod configuration file. It should something like, `Pods-Pods.config`. – Mohammad Abdurraafay Nov 06 '13 at 06:52
  • In the Info Tab on my project Target,under custom iOS target properties I can see a configuration key and it is set as ${CONFIGURATION}. Is that the one you specified? – Hari Nov 06 '13 at 07:15
  • I added a 'libPods-MyProjectTests-KIF.a' to `Link Binary With Libraries` on my test target, and it resolved the issue. – Albert Bori Jan 30 '15 at 07:41
1

It worked for me to remove the XCTest framework. I know that might be something you don't want to do though.

michaelsnowden
  • 6,031
  • 2
  • 38
  • 83
0

I have solved the problem with the help of my colleague. Two steps: 1、just update the cocoapods to 0.29.0,because 0.29.0 just fix a bug,more detail ,see: https://github.com/CocoaPods/CocoaPods/issues/1558 use command: sudo gem install cocoapods pod install pod update 2、if you want run your app on ios devices,just change the Build Settings->Architectures,the value of it to (Standard Architecture (armv7,armv7s)),