xcode 需要帮助:“错误的架构”导致应用在 iOS 7 中启动时崩溃,但在 iOS 8 中运行良好

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26958232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:10:58  来源:igfitidea点击:

Need help: 'Wrong Architecture' causing app to crash when launching in iOS 7 but works fine in iOS 8

xcodeios7ios8mach-o

提问by CaptainJ

My app crashes when I launch it in iOS 7.1 but works fine in iOS 8.1

我的应用程序在 iOS 7.1 中启动时崩溃,但在 iOS 8.1 中运行良好

The error I get is this:

我得到的错误是这样的:

dyld: Library not loaded: /System/Library/Frameworks/AVKit.framework/AVKit Referenced from: MY APPReason: no suitable image found. Did find: /System/Library/Frameworks/AVKit.framework/AVKit: mach-o, but wrong architecture (lldb)

dyld:库未加载:/System/Library/Frameworks/AVKit.framework/AVKit 引用自:MY APP原因:未找到合适的图像。确实找到了:/System/Library/Frameworks/AVKit.framework/AVKit:mach-o,但架构错误(lldb)

I also noticed a similar error but with the UIKit mentioned instead of AVKit a few edits ago.

我也注意到一个类似的错误,但在几次编辑之前提到了 UIKit 而不是 AVKit。

Does anyone know how to resolve this? I'm using Xcode 6.1.

有谁知道如何解决这个问题?我正在使用 Xcode 6.1。

I really don't want to miss out on iOS 7 users by only releasing for iOS 8. Thank you!

我真的不想因为只发布 iOS 8 而错过 iOS 7 用户。谢谢!

回答by Shabir jan

The app is crashing because the framework AVKit is introduced in iOS 8 only, so when you try to compile the app for iOS 7 the app crashes as iOS 7 SDK does not include AVKit framework.

应用程序崩溃是因为框架 AVKit 仅在 iOS 8 中引入,因此当您尝试为 iOS 7 编译应用程序时,应用程序崩溃,因为 iOS 7 SDK 不包含 AVKit 框架。

回答by iSwaroop

You can do one thing, set the framework as optional. No need to remove the framework.enter image description here

您可以做一件事,将框架设置为可选。无需移除框架。在此处输入图片说明