简体   繁体   中英

iOS app won't compile on device but works fine in simulator

I'm assuming this has something to do with linking, but I've removed RestKit and re-added it. I made sure all my connections and linking was in place. If I set XCode to use the simulator it runs fine, but as soon as I set it to run on any device it won't even build. The only other thing of note is this didn't start happening till I upgraded to XCode 4.5. Below are the errors it gives me

ld: warning: ignoring file /Users/luke/Library/Developer/Xcode/DerivedData/ehrx-btsujlxuhtytahfaikwjeqfjybtt/Build/Products/Debug-iphoneos/libRestKit.a, file was built for archive which is not the architecture being linked (armv7s): /Users/luke/Library/Developer/Xcode/DerivedData/ehrx-btsujlxuhtytahfaikwjeqfjybtt/Build/Products/Debug-iphoneos/libRestKit.a
Undefined symbols for architecture armv7s:
  "_OBJC_CLASS_$_RKClient", referenced from:
      objc-class-ref in ehrxAppDelegate.o
      objc-class-ref in ehrxLoginView.o
      objc-class-ref in ehrxInboxView.o
      objc-class-ref in ehrxCMView.o
      objc-class-ref in ehrxEncounterDemoView.o
      objc-class-ref in ehrxEncounterDiagListView.o
      objc-class-ref in ehrxEncounterChargeView.o
      ...
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

These are the build settings for RestKit. 在此输入图像描述

Looks like those frameworks are not built to work on armv7s devices, if its not necessary, remove it from your "Valid Architectures" in Build Settings.

If not, you will have to update them to work on armv7s

The linker complains about missing data for the armv7s in your RestKit library.

Please add this architecture in your RestKit project as a valid architecture. This is much better than removing armv7s from your main project, for obvious reasons.

It's because your library RestKit is only compiled for architecture armv7 and not for the new iPhone architecture armv7s. If you haven't the lib compiled for armv7s, try to remove armv7s to the list of architectures and valid architectures in your project settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM