[英]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. 我假设这与链接有关,但我已经删除了RestKit并重新添加了它。 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.
如果我设置XCode使用模拟器它运行正常,但一旦我将其设置为在任何设备上运行它甚至不会构建。 The only other thing of note is this didn't start happening till I upgraded to XCode 4.5.
唯一值得注意的是,在我升级到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. 这些是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. 看起来这些框架不是为了在armv7s设备上运行而构建的,如果没有必要,可以从Build Settings中的“Valid Architectures”中删除它。
If not, you will have to update them to work on armv7s 如果没有,您将不得不更新它们以使用armv7s
The linker complains about missing data for the armv7s in your RestKit library. 链接器抱怨您的RestKit库中的armv7缺少数据。
Please add this architecture in your RestKit project as a valid architecture. 请将此体系结构作为有效的体系结构添加到RestKit项目中。 This is much better than removing armv7s from your main project, for obvious reasons.
由于显而易见的原因,这比从主项目中删除armv7要好得多。
It's because your library RestKit is only compiled for architecture armv7 and not for the new iPhone architecture armv7s. 这是因为您的库RestKit仅针对架构armv7而不是针对新的iPhone架构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.
如果您没有为armv7s编译lib,请尝试将armv7s删除到项目设置中的体系结构和有效体系结构列表中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.