简体   繁体   English

iOS应用程序不会在设备上编译,但在模拟器中工作正常

[英]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.

相关问题 iOS App在Simulator上运行正常,但在真实的iOS设备上崩溃 - iOS App works fine with Simulator but Crashes with a real iOS device 应用程序在Simulator(Xcode 7.1.1)中运行良好,但在iOS设备上运行不正常 - app works fine in Simulator (Xcode 7.1.1) but not on iOS device Firebase 在 ios 模拟器上运行良好,但在真实设备上不起作用 - Firebase works fine on ios simulator but it does't work on real device 在设备上启动app的例外,在模拟器中工作正常 - Exception on app startup in device,works fine in simulator Monotouch App不会在Device上启动,但在Simulator中工作正常 - Monotouch App will not launch on Device but works fine in Simulator 应用程式在装置上当机,但在Simulator上运作正常 - App crashes on device, however works fine on Simulator iOS应用可以运行一个很好的模拟器,但不能在设备上运行 - iOS app runs fine one simulator but not on device iOS 应用程序在手机上崩溃,但在模拟器上运行良好 - iOS App Crashes on Phone but works fine on simulator FirebaseCrashlytics 不会为 iOS 模拟器编译 - FirebaseCrashlytics won't compile for iOS simulator IOS App在iTunes版本上崩溃,但在本地模拟器和真实设备测试中运行良好 - IOS App crashed on iTunes' version, but works fine on local simulator & real device testing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM